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

The following examples show how to use ca.uhn.fhir.rest.param.StringParam. 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: 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 #2
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 #3
Source File: GraphDefinitionDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
public List<GraphDefinition> search (FhirContext ctx,
                              @OptionalParam(name = GraphDefinition.SP_NAME) StringParam name,
                              @OptionalParam(name = GraphDefinition.SP_PUBLISHER) StringParam publisher,
                              @OptionalParam(name = GraphDefinition.SP_URL) UriParam url

) {
    List<GraphDefinition> results = new ArrayList<>();
    List<GraphDefinitionEntity> qryResults = searchEntity(ctx, name, publisher, url);

    for (GraphDefinitionEntity graphEntity : qryResults) {
        if (graphEntity.getResource() != null) {
            results.add((GraphDefinition) ctx.newJsonParser().parseResource(graphEntity.getResource()));
        } else {

            GraphDefinition graph = graphEntityToFHIRValuesetTransformer.transform(graphEntity);
            String resource = ctx.newJsonParser().encodeResourceToString(graph);
            if (resource.length() < 10000) {
                graphEntity.setResource(resource);
                em.persist(graphEntity);
            }
            results.add(graph);
        }
    }
    return results;
}
 
Example #4
Source File: TaskDao.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 = 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
) {

    List<TaskEntity> qryResults =  searchEntity(ctx,patient, identifier,id, owner, requester, status,code);
    List<Resource> results = new ArrayList<>();

    for (TaskEntity taskIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        Task task = taskEntityToFHIRTask.transform(taskIntoleranceEntity, ctx);
        results.add(task);
    }

    return results;
}
 
Example #5
Source File: StructureDefinitionDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
public List<StructureDefinition> search (FhirContext ctx,
									  @OptionalParam(name = StructureDefinition.SP_NAME) StringParam name,
									  @OptionalParam(name = StructureDefinition.SP_PUBLISHER) StringParam publisher,
									  @OptionalParam(name = StructureDefinition.SP_URL) UriParam url
) {
	List<StructureDefinitionEntity> qryResults = searchEntity(ctx,name,publisher, url);
	List<StructureDefinition> results = new ArrayList<>();

	for (StructureDefinitionEntity structureDefinitionEntity : qryResults)
	{

		StructureDefinition structureDefinition = structureDefinitionEntityToFHIRStructureDefinitionTransformer.transform(structureDefinitionEntity, ctx);

		results.add(structureDefinition);

	}
	return results;
}
 
Example #6
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 #7
Source File: PersonDao.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
@Override
public List<Resource> search(FhirContext ctx,
                             @OptionalParam(name = Person.SP_NAME) StringParam name,
                             @OptionalParam(name = Person.SP_IDENTIFIER) TokenParam identifier,
                             @OptionalParam(name = Person.SP_EMAIL) TokenParam email,
                             @OptionalParam(name = Person.SP_PHONE) TokenParam phone

) {
    List<PersonEntity> qryResults = searchEntity(ctx, name, identifier,email, phone);
    List<Resource> results = new ArrayList<>();

    for (PersonEntity personEntity : qryResults) {
        log.info("personEntity = " + personEntity.getId().toString());
        Person person = personEntityToFHIRPersonTransformer.transform(personEntity);
        String resourceStr = ctx.newJsonParser().encodeResourceToString(person);
        personEntity.setResource(resourceStr);

        results.add(person);

        // If reverse include selected

    }


    return results;
}
 
Example #8
Source File: MedicationRequestProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<MedicationRequest> search(HttpServletRequest theRequest,
                                      @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_RES_ID) StringParam resid
        , @OptionalParam(name = MedicationRequest.SP_IDENTIFIER)  TokenParam identifierCode
        , @OptionalParam(name = MedicationRequest.SP_MEDICATION) ReferenceParam medication
                                      ) {
    return prescriptionDao.search(ctx,patient, code, dateWritten, status,identifierCode,resid,medication);
}
 
Example #9
Source File: ScheduleProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Schedule> searchSchedule(HttpServletRequest theRequest,
                                                       @OptionalParam(name = Schedule.SP_IDENTIFIER) TokenParam identifier,
                                                      // @OptionalParam(name = Schedule.SP_ACTOR) StringParam name,
                                                      // @OptionalParam(name= Schedule.SP_TYPE) TokenOrListParam codes,
                                                       @OptionalParam(name = Schedule.SP_RES_ID) StringParam id
) {
    return scheduleDao.searchSchedule(ctx, identifier,id);
}
 
Example #10
Source File: RiskAssessmentProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<RiskAssessment> search(HttpServletRequest theRequest,
                             @OptionalParam(name = RiskAssessment.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = RiskAssessment.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = RiskAssessment.SP_RES_ID) StringParam id
) {
    return riskAssessmentDao.search(ctx,patient, identifier,id);
}
 
Example #11
Source File: QuestionnaireResponseRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<QuestionnaireResponseEntity> searchQuestionnaireResponseEntity (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 #12
Source File: ImmunizationProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Immunization> search(HttpServletRequest theRequest,
                                      @OptionalParam(name = Immunization.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Immunization.SP_DATE) DateRangeParam date
        , @OptionalParam(name = Immunization.SP_STATUS) TokenParam status
        , @OptionalParam(name = Immunization.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Immunization.SP_RES_ID) StringParam resid
        , @OptionalParam(name= "vaccination-procedure") TokenParam procedureCode
        , @OptionalParam(name= Immunization.SP_NOTGIVEN) TokenParam notGiven
){
    return immunisationDao.search(ctx,patient,date, status, identifier,resid, procedureCode, notGiven);
}
 
Example #13
Source File: FlagProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Flag> searchQuestionnaire(HttpServletRequest theRequest,
                                                       @OptionalParam(name = Flag.SP_IDENTIFIER) TokenParam identifier,
                                                       @OptionalParam(name= Flag.SP_RES_ID) StringParam id,
                                                       @OptionalParam(name = Flag.SP_PATIENT) ReferenceParam patient
) {
    return flagDao.searchFlag(ctx, identifier,id,patient);
}
 
Example #14
Source File: ListDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<ListResource> searchListResource(FhirContext ctx, TokenParam identifier, StringParam id, ReferenceParam patient) {
    List<ListEntity> qryResults = searchListEntity(ctx, identifier, id,  patient);
    List<ListResource> results = new ArrayList<>();

    for (ListEntity list : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        ListResource questionnaireResponse = listEntityToFHIRListResourceTranslister.transform(list);
        results.add(questionnaireResponse);
    }

    return results;
}
 
Example #15
Source File: MedicationDao.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Override
public List<Medication> search(FhirContext ctx, TokenParam code, StringParam id) {
    List<MedicationEntity> results = searchEntity(ctx,code,id);
    List<Medication> res = new ArrayList<>();

    for (MedicationEntity medication :results) {
        res.add(medicationRequestEntityToFHIRMedicationTransformer.transform(medication));
    }
    return res;
}
 
Example #16
Source File: ReferralRequestProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<ReferralRequest> searchReferralRequest(HttpServletRequest theRequest,
           @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
) {
    return referralDao.searchReferralRequest(ctx, identifier,codes,id,patient);
}
 
Example #17
Source File: ConsentProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Consent> search(HttpServletRequest theRequest,
                             @OptionalParam(name = Consent.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = Consent.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Consent.SP_RES_ID) StringParam id
) {
    return consentDao.search(ctx,patient, identifier,id);
}
 
Example #18
Source File: MedicationStatementProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<MedicationStatement> search(HttpServletRequest theRequest,
                                        @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 resid
        , @OptionalParam(name = MedicationStatement.SP_IDENTIFIER) TokenParam identifier
) {
    return statementDao.search(ctx,patient, effectiveDate, status,resid, identifier);
}
 
Example #19
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 #20
Source File: MedicationStatementRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<MedicationStatement> search(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 #21
Source File: EpisodeOfCareProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<EpisodeOfCare> search(HttpServletRequest theRequest,
                                               @OptionalParam(name = EpisodeOfCare.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = EpisodeOfCare.SP_DATE) DateRangeParam date
        , @OptionalParam(name = EpisodeOfCare.SP_RES_ID) StringParam resid
        ,@OptionalParam(name= EpisodeOfCare.SP_IDENTIFIER) TokenParam identifier) {
    return episodeDao.search(ctx,patient, date,resid, identifier);
}
 
Example #22
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 #23
Source File: CodeSystemProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<CodeSystem> search(HttpServletRequest theRequest,
             @OptionalParam(name =CodeSystem.SP_NAME) StringParam name,
           //  @OptionalParam(name = CodeSystem.SP_PUBLISHER) StringParam publisher,
             @OptionalParam(name = CodeSystem.SP_URL) UriParam url)

{
    return codeSystemDao.search(ctx, name, null,url);
}
 
Example #24
Source File: ProcedureRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<ProcedureEntity> searchEntity(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 #25
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 #26
Source File: AppointmentProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<Appointment> searchAppointment(HttpServletRequest theRequest,
                                                       @OptionalParam(name = Appointment.SP_IDENTIFIER) TokenParam identifier,
                                                   //    @OptionalParam(name = Appointment.SP_APPOINTMENT_TYPE) StringParam appointmentType,
                                                   //    @OptionalParam(name = Appointment.SP_STATUS) StringParam status,
                                                       @OptionalParam(name = Appointment.SP_RES_ID) StringParam id
) {
    return appointmentDao.searchAppointment(ctx, identifier, id);
}
 
Example #27
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 #28
Source File: TaskRepository.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
List<Resource> search(
        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 #29
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 #30
Source File: CareTeamProvider.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
@Search
public List<CareTeam> search(HttpServletRequest theRequest,
                             @OptionalParam(name = CareTeam.SP_PATIENT) ReferenceParam patient
        , @OptionalParam(name = CareTeam.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = CareTeam.SP_RES_ID) StringParam id
) {
    return careTeamDao.search(ctx,patient, identifier,id);
}