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

The following examples show how to use ca.uhn.fhir.rest.param.TokenParam. These examples are extracted from open source projects. 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
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
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
@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 4
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
@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
List<MedicationAdministration> search(FhirContext ctx,

                                    @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

    );
 
Example 7
@Override
public List<NamingSystem> search (FhirContext ctx,
                                  @OptionalParam(name = NamingSystem.SP_NAME) StringParam name,
                                  @OptionalParam(name = NamingSystem.SP_PUBLISHER) StringParam publisher,
                                  @OptionalParam(name = NamingSystem.SP_VALUE) TokenParam unique
) {

    List<NamingSystemEntity> qryResults = searchEntity(ctx, name,publisher,unique);
    List<NamingSystem> results = new ArrayList<>();

    for (NamingSystemEntity namingSystemEntity : qryResults)
    {
        if (namingSystemEntity.getResource() != null) {
            results.add(namingSystemEntityToFHIRValuesetTransformer.transform(namingSystemEntity, ctx));
        } else {

            NamingSystem namingSystem = namingSystemEntityToFHIRValuesetTransformer.transform(namingSystemEntity, ctx);
            String resource = ctx.newJsonParser().encodeResourceToString(namingSystem);
            if (resource.length() < 10000) {
                namingSystemEntity.setResource(resource);
                em.persist(namingSystemEntity);
            }
            results.add(namingSystem);
        }
    }
    return results;
}
 
Example 8
@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);
}
 
Example 9
@Search
public List<Resource> searchRelatedPerson(HttpServletRequest theRequest,
                                          @OptionalParam(name = RelatedPerson.SP_IDENTIFIER) TokenParam identifier,
                                          @OptionalParam(name = RelatedPerson.SP_PATIENT) ReferenceParam patient,
                                          @OptionalParam(name = RelatedPerson.SP_RES_ID) StringParam resid
) {
    return personDao.search(ctx, identifier,patient,resid);
}
 
Example 10
@Override
public List<Consent> search(FhirContext ctx, ReferenceParam patient, TokenParam identifier, StringParam id) {
    List<ConsentEntity> qryResults = searchEntity(ctx,patient, identifier,id);
    List<Consent> results = new ArrayList<>();

    for (ConsentEntity consentIntoleranceEntity : qryResults)
    {
        // log.trace("HAPI Custom = "+doc.getId());
        Consent consent = consentEntityToFHIRConsentTransformer.transform(consentIntoleranceEntity);
        results.add(consent);
    }

    return results;
}
 
Example 11
List<Composition> search(FhirContext ctx,

              @OptionalParam(name = Condition.SP_PATIENT) ReferenceParam patient
            , @OptionalParam(name = Composition.SP_IDENTIFIER) TokenParam identifier
            , @OptionalParam(name = Composition.SP_RES_ID) StringParam id
            , @OptionalParam(name = Composition.SP_TYPE) TokenParam type
            , @OptionalParam(name = Composition.SP_PERIOD)DateRangeParam dateRange

    );
 
Example 12
@Override
public PractitionerEntity readEntity(FhirContext ctx, TokenParam identifier) {

    List<PractitionerEntity> pracs= searchPractitionerEntity(ctx, identifier, null, null,null);
    for (PractitionerEntity prac : pracs) {
        return prac;
    }

    return null;
}
 
Example 13
@Override
public PatientEntity readEntity(FhirContext ctx, TokenParam identifier) {
    PatientEntity patient = null;
    List<PatientEntity> patients = searchEntity(ctx, null,null,null,null,null,null,identifier,null,null,null, null, null);
    for (PatientEntity resource : patients ) {
        return resource;
    }
    return patient;
}
 
Example 14
List<AllergyIntolerance> search(
        FhirContext ctx,
        @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 id
        , @OptionalParam(name = AllergyIntolerance.SP_VERIFICATION_STATUS) TokenParam verificationStatus

);
 
Example 15
List<AllergyIntoleranceEntity> searchEntity(FhirContext ctx,
        @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 id
        , @OptionalParam(name = AllergyIntolerance.SP_VERIFICATION_STATUS) TokenParam verificationStatus
);
 
Example 16
List<Immunization> search(FhirContext ctx,

            @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 id
            , @OptionalParam(name= "vaccination-procedure") TokenParam procedureCode
            , @OptionalParam(name= Immunization.SP_NOTGIVEN) TokenParam notGiven

    );
 
Example 17
@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 18
@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 19
@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);
}
 
Example 20
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 21
@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 22
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 23
@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 24
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 25
@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 26
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 27
@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 28
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 29
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 30
@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;
}