ca.uhn.fhir.rest.param.TokenParam Java Examples

The following examples show how to use ca.uhn.fhir.rest.param.TokenParam. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ValueSetDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
public List<ValueSet> search (FhirContext ctx,
                              @OptionalParam(name = ValueSet.SP_NAME) StringParam name,
                              @OptionalParam(name = ValueSet.SP_PUBLISHER) StringParam publisher,
                              @OptionalParam(name = ValueSet.SP_URL) UriParam url,
                              @OptionalParam(name = ValueSet.SP_IDENTIFIER) TokenParam identifier
) {
    List<ValueSet> results = new ArrayList<ValueSet>();
    List<ValueSetEntity> qryResults = searchEntity(ctx, name, publisher, url, identifier);

    for (ValueSetEntity valuesetEntity : qryResults) {
        if (valuesetEntity.getResource() != null) {
            results.add((ValueSet) ctx.newJsonParser().parseResource(valuesetEntity.getResource()));
        } else {

            ValueSet valueSet = valuesetEntityToFHIRValuesetTransformer.transform(valuesetEntity);
            String resource = ctx.newJsonParser().encodeResourceToString(valueSet);
            if (resource.length() < 10000) {
                valuesetEntity.setResource(resource);
                em.persist(valuesetEntity);
            }
            results.add(valueSet);
        }
    }
    return results;
}
 
Example #2
Source File: ClaimDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
@Override
public List<Resource> search(FhirContext ctx, ReferenceParam patient, TokenParam identifier, StringParam id
        , @OptionalParam(name = Claim.SP_USE) TokenParam use
        , @OptionalParam(name = "status") TokenParam status) {

    List<ClaimEntity> qryResults =  searchEntity(ctx,patient, identifier,id, use, status);
    List<Resource> results = new ArrayList<>();

    for (ClaimEntity claimIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        Claim claim = claimEntityToFHIRClaim.transform(claimIntoleranceEntity, ctx);
        results.add(claim);
    }

    return results;
}
 
Example #3
Source File: EncounterRepository.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
List<Resource> search(FhirContext ctx,

                          @OptionalParam(name = Encounter.SP_PATIENT) ReferenceParam patient
            , @OptionalParam(name = Encounter.SP_DATE) DateRangeParam date
            , @OptionalParam(name = Encounter.SP_EPISODEOFCARE) ReferenceParam episode
            , @OptionalParam(name = Encounter.SP_IDENTIFIER) TokenParam identifier
            , @OptionalParam(name= Encounter.SP_RES_ID) StringParam id
            , @IncludeParam(reverse=true, allow = {
            "Observation:context",
            "Encounter:part-of",
            "Procedure:context",
            "Condition:context",
            "MedicationRequest:context",
            "Immunization:encounter" ,
            "DocumentReference:context",
            "Composition:encounter",
            "ReferralRequest:encounter",
            "MedicationDispense:context",
            "MedicationAdministration:context",
            "*"
    }) Set<Include> reverseIncludes
            , @IncludeParam(allow = { "Encounter.participant" , "Encounter.service-provider", "Encounter.location", "*"
    }) Set<Include> includes
            , @OptionalParam(name = Encounter.SP_TYPE) TokenParam type
            , @OptionalParam(name = Encounter.SP_STATUS) TokenParam status
    );
 
Example #4
Source File: MessageDefinitionDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
public List<MessageDefinition> search (FhirContext ctx,
                                       @OptionalParam(name = MessageDefinition.SP_NAME) StringParam name,
                                       @OptionalParam(name = MessageDefinition.SP_PUBLISHER) StringParam publisher,
                                       @OptionalParam(name = MessageDefinition.SP_URL) UriParam url,
                                       @OptionalParam(name = MessageDefinition.SP_IDENTIFIER) TokenParam identifier
) {
    List<MessageDefinitionEntity> qryResults = searchEntity(ctx, name, publisher, url, identifier);
    List<MessageDefinition> results = new ArrayList<MessageDefinition>();

    for (MessageDefinitionEntity messageDefinitionEntity : qryResults)
    {
        if (messageDefinitionEntity.getResource() != null) {
            results.add((MessageDefinition) ctx.newJsonParser().parseResource(messageDefinitionEntity.getResource()));
        } else {

            MessageDefinition messageDefinition = messageDefinitionEntityToFHIRValuesetTransformer.transform(messageDefinitionEntity);
            String resource = ctx.newJsonParser().encodeResourceToString(messageDefinition);
            if (resource.length() < 10000) {
                messageDefinitionEntity.setResource(resource);
                em.persist(messageDefinitionEntity);
            }
            results.add(messageDefinition);
        }
    }
    return results;
}
 
Example #5
Source File: EncounterProvider.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
@Search
public List<Resource> search(HttpServletRequest theRequest,
                             @OptionalParam(name = Encounter.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Encounter.SP_DATE) DateRangeParam date
        , @OptionalParam(name = Encounter.SP_EPISODEOFCARE) ReferenceParam episode
        , @OptionalParam(name = Encounter.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Encounter.SP_RES_ID) StringParam resid
        , @IncludeParam(reverse=true, allow = {
        "Observation:context",
        "Encounter:part-of",
        "Procedure:context",
        "Condition:context",
        "MedicationRequest:context",
        "Immunization:encounter" ,
        "DocumentReference:context",
        "Composition:encounter",
        "ReferralRequest:encounter",
        "*"
}) Set<Include> reverseIncludes
        , @IncludeParam(allow = { "Encounter:participant" , "Encounter:patient" ,"Encounter:service-provider", "Encounter:location", "*"
}) Set<Include> includes
        , @OptionalParam(name = Encounter.SP_TYPE) TokenParam type
        , @OptionalParam(name = Encounter.SP_STATUS) TokenParam status
) {
    return encounterDao.search(ctx,patient,date,episode,identifier,resid,reverseIncludes, includes, type, status);
}
 
Example #6
Source File: QuestionnaireResponseRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
public List<Resource> searchQuestionnaireResponse(FhirContext ctx,

                                                      @OptionalParam(name = QuestionnaireResponse.SP_IDENTIFIER) TokenParam identifier,
                                                      @OptionalParam(name= QuestionnaireResponse.SP_RES_ID) StringParam id,
                                                      @OptionalParam(name= QuestionnaireResponse.SP_QUESTIONNAIRE) ReferenceParam questionnaire,
                                                      @OptionalParam(name = QuestionnaireResponse.SP_PATIENT) ReferenceParam patient,
                                                      @IncludeParam(allow= {"*"}) Set<Include> includes

    );
 
Example #7
Source File: EpisodeOfCareDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<EpisodeOfCare> search(FhirContext ctx,ReferenceParam patient, DateRangeParam date, StringParam resid, TokenParam identifier) {

    List<EpisodeOfCareEntity> qryResults = searchEntity(ctx,patient, date,resid,identifier);
    List<EpisodeOfCare> results = new ArrayList<>();

    for (EpisodeOfCareEntity episodeEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        EpisodeOfCare episode = episodeOfCareEntityToFHIREpisodeOfCareTransformer.transform(episodeEntity);
        results.add(episode);
    }

    return results;
}
 
Example #8
Source File: TaskProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Resource> search(HttpServletRequest theRequest,
                             @OptionalParam(name = Task.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Task.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Task.SP_RES_ID) StringParam id
        , @OptionalParam(name = Task.SP_OWNER) ReferenceParam owner
        , @OptionalParam(name = Task.SP_REQUESTER) ReferenceParam requester
        , @OptionalParam(name = Task.SP_STATUS) TokenParam status
        , @OptionalParam(name = Task.SP_CODE) TokenParam code
) {
    return taskDao.search(ctx,patient, identifier,id, owner, requester,status, code);
}
 
Example #9
Source File: EndpointDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Endpoint> searchEndpoint(FhirContext ctx, TokenParam identifier, StringParam resid) {
    List<EndpointEntity> qryResults = searchEndpointEntity(ctx,identifier,resid);
    List<Endpoint> results = new ArrayList<>();

    for (EndpointEntity endpointEntity : qryResults)
    {
        Endpoint endpoint = endpointEntityToFHIREndpointTransform.transform(endpointEntity);
        results.add(endpoint);
    }

    return results;
}
 
Example #10
Source File: GoalDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Goal> search(FhirContext ctx, ReferenceParam patient, TokenParam identifier, StringParam id) {
    List<GoalEntity> qryResults = searchEntity(ctx,patient, identifier,id);
    List<Goal> results = new ArrayList<>();

    for (GoalEntity goalIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        Goal goal = goalEntityToFHIRGoalTransformer.transform(goalIntoleranceEntity);
        results.add(goal);
    }

    return results;
}
 
Example #11
Source File: LibDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
public PatientEntity findPatientEntity(FhirContext ctx, Reference ref) {
    PatientEntity patientEntity = null;
    if (ref.hasReference()) {
        log.trace(ref.getReference());
        patientEntity = patientDao.readEntity(ctx, new IdType(ref.getReference()));

    }
    if (ref.hasIdentifier()) {
        // This copes with reference.identifier param (a short cut?)
        log.trace(ref.getIdentifier().getSystem() + " " + ref.getIdentifier().getValue());
        patientEntity = patientDao.readEntity(ctx, new TokenParam().setSystem(ref.getIdentifier().getSystem()).setValue(ref.getIdentifier().getValue()));
    }
    return patientEntity;
}
 
Example #12
Source File: ProcedureRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<Procedure> search(FhirContext ctx,
        @OptionalParam(name = Procedure.SP_PATIENT) ReferenceParam patient
        ,@OptionalParam(name = Procedure.SP_DATE) DateRangeParam date
        , @OptionalParam(name = Procedure.SP_SUBJECT) ReferenceParam subject
        , @OptionalParam(name = Procedure.SP_IDENTIFIER) TokenParam identifier
        ,@OptionalParam(name= Procedure.SP_RES_ID) StringParam id
);
 
Example #13
Source File: FlagDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Flag> searchFlag(FhirContext ctx, TokenParam identifier, StringParam id, ReferenceParam patient) {
    List<FlagEntity> qryResults = searchFlagEntity(ctx, identifier, id,  patient);
    List<Flag> results = new ArrayList<>();

    for (FlagEntity flag : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        Flag questionnaireResponse = flagEntityToFHIRFlagTransformer.transform(flag);
        results.add(questionnaireResponse);
    }

    return results;
}
 
Example #14
Source File: ReferralRequestRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<ReferralRequestEntity> searchReferralRequestEntity(FhirContext ctx,

        @OptionalParam(name = ReferralRequest.SP_IDENTIFIER) TokenParam identifier,
        @OptionalParam(name = ReferralRequest.SP_TYPE) TokenOrListParam codes,
        @OptionalParam(name = ReferralRequest.SP_RES_ID) StringParam id,
        @OptionalParam(name = ReferralRequest.SP_PATIENT) ReferenceParam patient
    );
 
Example #15
Source File: RiskAssessmentDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<RiskAssessment> search(FhirContext ctx, ReferenceParam patient, TokenParam identifier, StringParam id) {
    List<RiskAssessmentEntity> qryResults = searchEntity(ctx,patient, identifier,id);
    List<RiskAssessment> results = new ArrayList<>();

    for (RiskAssessmentEntity riskIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        RiskAssessment risk = riskEntityToFHIRRiskAssessmentTransformer.transform(riskIntoleranceEntity);
        results.add(risk);
    }

    return results;
}
 
Example #16
Source File: ReferralRequestRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<ReferralRequest> searchReferralRequest(FhirContext ctx,

        @OptionalParam(name = ReferralRequest.SP_IDENTIFIER) TokenParam identifier,
        @OptionalParam(name = ReferralRequest.SP_TYPE) TokenOrListParam codes,
        @OptionalParam(name = ReferralRequest.SP_RES_ID) StringParam id,
        @OptionalParam(name = ReferralRequest.SP_PATIENT) ReferenceParam patient

    );
 
Example #17
Source File: MedicationDispenseProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<MedicationDispense> search(HttpServletRequest theRequest,
                                       @OptionalParam(name = MedicationDispense.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = MedicationDispense.SP_STATUS) TokenParam status
        , @OptionalParam(name = MedicationDispense.SP_RES_ID) StringParam id
        , @OptionalParam(name = MedicationDispense.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = MedicationDispense.SP_CODE) TokenParam code
        , @OptionalParam(name= MedicationDispense.SP_MEDICATION) ReferenceParam medication
                                      ) {
    return dispenseDao.search(ctx,patient, status, id, identifier,code, medication );
}
 
Example #18
Source File: ConditionRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<ConditionEntity> searchEntity(FhirContext ctx,
        @OptionalParam(name = Condition.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Condition.SP_CATEGORY) TokenParam category
        , @OptionalParam(name = Condition.SP_CLINICAL_STATUS) TokenParam clinicalstatus
        , @OptionalParam(name = Condition.SP_ASSERTED_DATE) DateRangeParam asserted
        , @OptionalParam(name = Condition.SP_IDENTIFIER) TokenParam identifier
        ,@OptionalParam(name= Condition.SP_RES_ID) StringParam id
);
 
Example #19
Source File: ScheduleDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Schedule> searchSchedule(FhirContext ctx, TokenParam identifier,  StringParam id) { // , ReferenceParam organisation
    List<ScheduleEntity> qryResults = searchScheduleEntity(ctx,identifier,id); //,organisation
    List<Schedule> results = new ArrayList<>();

    for (ScheduleEntity scheduleEntity : qryResults) {
        Schedule schedule = scheduleEntityToFHIRScheduleTransformer.transform(scheduleEntity);
        results.add(schedule);
    }

    return results;
}
 
Example #20
Source File: OrganisationDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public OrganisationEntity readEntity(FhirContext ctx, TokenParam identifier) {
    OrganisationEntity organisationEntity = null;

    List<OrganisationEntity> orgs= searchOrganizationEntity(ctx, identifier, null, null,null);
    for (OrganisationEntity org : orgs) {
        return org;
    }

    return null;
}
 
Example #21
Source File: AppointmentDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Appointment> searchAppointment(FhirContext ctx, TokenParam identifier, StringParam id) { // , ReferenceParam organisation
    List<AppointmentEntity> qryResults = searchAppointmentEntity(ctx,identifier, id); //,organisation
    List<Appointment> results = new ArrayList<>();

    for (AppointmentEntity appointmentEntity : qryResults) {
        Appointment appointment = appointmentEntityToFHIRAppointmentTransformer.transform(appointmentEntity);
        results.add(appointment);
    }

    return results;
}
 
Example #22
Source File: MedicationStatementRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<MedicationStatementEntity> searchEntity(FhirContext ctx,
        @OptionalParam(name = MedicationStatement.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = MedicationStatement.SP_EFFECTIVE) DateRangeParam effectiveDate
        , @OptionalParam(name = MedicationStatement.SP_STATUS) TokenParam status
        ,@OptionalParam(name= MedicationStatement.SP_RES_ID) StringParam id
        , @OptionalParam(name = MedicationStatement.SP_IDENTIFIER) TokenParam identifier

);
 
Example #23
Source File: ProcedureProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Procedure> search(HttpServletRequest theRequest,
                              @OptionalParam(name = Procedure.SP_DATE) DateRangeParam date
        , @OptionalParam(name = Procedure.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Procedure.SP_SUBJECT) ReferenceParam subject
        , @OptionalParam(name = Procedure.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Procedure.SP_RES_ID) StringParam resid
                              ) {
    return procedureDao.search(ctx, patient, date, subject,identifier,resid);
}
 
Example #24
Source File: CareTeamDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<CareTeam> search(FhirContext ctx, ReferenceParam patient, TokenParam identifier, StringParam id) {
    List<CareTeamEntity> qryResults = searchEntity(ctx,patient, identifier,id);
    List<CareTeam> results = new ArrayList<>();

    for (CareTeamEntity teamIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        CareTeam team = teamEntityToFHIRCareTeamTransformer.transform(teamIntoleranceEntity);
        results.add(team);
    }

    return results;
}
 
Example #25
Source File: TaskRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<TaskEntity> searchEntity(FhirContext ctx,
                               @OptionalParam(name = Task.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Task.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Task.SP_RES_ID) StringParam id
        , @OptionalParam(name = Task.SP_OWNER) ReferenceParam owner
        , @OptionalParam(name = Task.SP_REQUESTER) ReferenceParam requester
        , @OptionalParam(name = Task.SP_STATUS) TokenParam status
        , @OptionalParam(name = Task.SP_CODE) TokenParam code
);
 
Example #26
Source File: MedicationAdministrationDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<MedicationAdministration> search(FhirContext ctx, ReferenceParam patient, TokenParam status, StringParam id, TokenParam identifier, TokenParam code, ReferenceParam medication) {
    List<MedicationAdministrationEntity> qryResults = searchEntity(ctx,patient, status,id,identifier,code,medication);
    List<MedicationAdministration> results = new ArrayList<>();

    for (MedicationAdministrationEntity medicationAdministrationIntoleranceEntity : qryResults) {
        MedicationAdministration medicationAdministration = medicationAdministrationEntityToFHIRMedicationAdministrationTransformer.transform(medicationAdministrationIntoleranceEntity);
        results.add(medicationAdministration);
    }

    return results;
}
 
Example #27
Source File: MedicationRequestRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<MedicationRequestEntity> searchEntity(FhirContext ctx,
        @OptionalParam(name = MedicationRequest.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = MedicationRequest.SP_CODE) TokenParam code
        , @OptionalParam(name = MedicationRequest.SP_AUTHOREDON) DateRangeParam dateWritten
        , @OptionalParam(name = MedicationRequest.SP_STATUS) TokenParam status
        , @OptionalParam(name = MedicationRequest.SP_IDENTIFIER) TokenParam identifier
        ,@OptionalParam(name= MedicationRequest.SP_RES_ID) StringParam id
        , @OptionalParam(name= MedicationRequest.SP_MEDICATION) ReferenceParam medication
);
 
Example #28
Source File: MedicationAdministrationProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<MedicationAdministration> search(HttpServletRequest theRequest,
                                       @OptionalParam(name = MedicationAdministration.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = MedicationAdministration.SP_STATUS) TokenParam status
        , @OptionalParam(name = MedicationAdministration.SP_RES_ID) StringParam id
        , @OptionalParam(name = MedicationAdministration.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = MedicationAdministration.SP_CODE) TokenParam code
        , @OptionalParam(name= MedicationAdministration.SP_MEDICATION) ReferenceParam medication
                                      ) {
    return administrationDao.search(ctx,patient, status, id, identifier,code, medication );
}
 
Example #29
Source File: MedicationDispenseRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<MedicationDispenseEntity> searchEntity(FhirContext ctx,
                                             @OptionalParam(name = MedicationDispense.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = MedicationDispense.SP_STATUS) TokenParam status
        , @OptionalParam(name = MedicationDispense.SP_RES_ID) StringParam id
        , @OptionalParam(name = MedicationDispense.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = MedicationDispense.SP_CODE) TokenParam code
        , @OptionalParam(name= MedicationDispense.SP_MEDICATION) ReferenceParam medication
);
 
Example #30
Source File: AllergyIntoleranceProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<AllergyIntolerance> search(HttpServletRequest theRequest,
                                       @OptionalParam(name = AllergyIntolerance.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = AllergyIntolerance.SP_DATE) DateRangeParam date
        , @OptionalParam(name = AllergyIntolerance.SP_CLINICAL_STATUS) TokenParam clinicalStatus
        , @OptionalParam(name = AllergyIntolerance.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = AllergyIntolerance.SP_RES_ID) StringParam resid
        , @OptionalParam(name = AllergyIntolerance.SP_VERIFICATION_STATUS) TokenParam verificationStatus
) {
    return allergyDao.search(ctx,patient, date, clinicalStatus,identifier,resid, verificationStatus);
}