use of org.hl7.fhir.r4.model.Identifier in project cqf-ruler by DBCG.
the class DetectedIssueBuilder method initializeR4.
@Override
protected void initializeR4(T theResource) {
super.initializeR4(theResource);
org.hl7.fhir.r4.model.DetectedIssue detectedIssue = (org.hl7.fhir.r4.model.DetectedIssue) theResource;
List<org.hl7.fhir.r4.model.Identifier> identifier = new ArrayList<>();
identifier.add(new org.hl7.fhir.r4.model.Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue()));
detectedIssue.setIdentifier(identifier).setPatient(new org.hl7.fhir.r4.model.Reference(myPatient)).setStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.valueOf(myStatus)).setCode(new CodeableConcept().addCoding(new Coding().setSystem(getCodeSetting().getSystem()).setCode(getCodeSetting().getCode()).setDisplay(getCodeSetting().getDisplay())));
getEvidenceDetails().forEach(evidence -> detectedIssue.addEvidence(new DetectedIssueEvidenceComponent().addDetail(new org.hl7.fhir.r4.model.Reference(evidence))));
}
use of org.hl7.fhir.r4.model.Identifier in project cqf-ruler by DBCG.
the class DetectedIssueBuilder method initializeDstu2_1.
@Override
protected void initializeDstu2_1(T theResource) {
super.initializeDstu2_1(theResource);
org.hl7.fhir.dstu2016may.model.DetectedIssue detectedIssue = (org.hl7.fhir.dstu2016may.model.DetectedIssue) theResource;
detectedIssue.setIdentifier(new Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue())).setPatient(new Reference(myPatient));
getEvidenceDetails().forEach(detectedIssue::setReference);
}
use of org.hl7.fhir.r4.model.Identifier in project cqf-ruler by DBCG.
the class ReportProvider method patientReport.
private Parameters.ParametersParameterComponent patientReport(Patient thePatient, Period thePeriod, String serverBase) {
String patientId = thePatient.getIdElement().getIdPart();
final Map<IIdType, IAnyResource> bundleEntries = new HashMap<>();
bundleEntries.put(thePatient.getIdElement(), thePatient);
ReferenceParam subjectParam = new ReferenceParam(patientId);
search(MeasureReport.class, Searches.byParam("subject", subjectParam)).getAllResourcesTyped().forEach(measureReport -> {
if (measureReport.getPeriod().getEnd().before(thePeriod.getStart()) || measureReport.getPeriod().getStart().after(thePeriod.getEnd())) {
return;
}
bundleEntries.putIfAbsent(measureReport.getIdElement(), measureReport);
getEvaluatedResources(measureReport).values().forEach(resource -> bundleEntries.putIfAbsent(resource.getIdElement(), resource));
});
Bundle patientReportBundle = new Bundle();
patientReportBundle.setMeta(new Meta().addProfile(PATIENT_REPORT_PROFILE_URL));
patientReportBundle.setType(Bundle.BundleType.COLLECTION);
patientReportBundle.setTimestamp(new Date());
patientReportBundle.setId(patientId + "-report");
patientReportBundle.setIdentifier(new Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:uuid:" + UUID.randomUUID().toString()));
bundleEntries.entrySet().forEach(resource -> patientReportBundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource.getValue()).setFullUrl(Operations.getFullUrl(serverBase, resource.getValue().fhirType(), resource.getValue().getIdElement().getIdPart()))));
Parameters.ParametersParameterComponent patientParameter = new Parameters.ParametersParameterComponent();
patientParameter.setResource(patientReportBundle);
patientParameter.setId(thePatient.getIdElement().getIdPart() + "-report");
patientParameter.setName("return");
return patientParameter;
}
use of org.hl7.fhir.r4.model.Identifier in project ipf by oehf.
the class Iti67ResourceProvider method documentReferenceSearch.
@SuppressWarnings("unused")
@Search(type = DocumentReference.class)
public IBundleProvider documentReferenceSearch(@RequiredParam(name = DocumentReference.SP_PATIENT, chainWhitelist = { "", Patient.SP_IDENTIFIER }) ReferenceParam patient, @OptionalParam(name = DocumentReference.SP_STATUS) TokenOrListParam status, @OptionalParam(name = DocumentReference.SP_IDENTIFIER) TokenParam identifier, @OptionalParam(name = DocumentReference.SP_DATE) DateRangeParam date, @OptionalParam(name = STU3_INDEXED) DateRangeParam indexed, @OptionalParam(name = DocumentReference.SP_AUTHOR, chainWhitelist = { Practitioner.SP_FAMILY, Practitioner.SP_GIVEN }) ReferenceAndListParam author, @OptionalParam(name = DocumentReference.SP_CATEGORY) TokenOrListParam category, @OptionalParam(name = STU3_CLASS) TokenOrListParam class_, @OptionalParam(name = DocumentReference.SP_TYPE) TokenOrListParam type, @OptionalParam(name = DocumentReference.SP_SETTING) TokenOrListParam setting, @OptionalParam(name = DocumentReference.SP_PERIOD) DateRangeParam period, @OptionalParam(name = DocumentReference.SP_FACILITY) TokenOrListParam facility, @OptionalParam(name = DocumentReference.SP_EVENT) TokenOrListParam event, @OptionalParam(name = DocumentReference.SP_SECURITY_LABEL) TokenOrListParam securityLabel, @OptionalParam(name = STU3_SECURITY_LABEL) TokenOrListParam label, @OptionalParam(name = DocumentReference.SP_FORMAT) TokenOrListParam format, @OptionalParam(name = DocumentReference.SP_RELATED, chainWhitelist = { "", DocumentReference.SP_IDENTIFIER }) ReferenceOrListParam related, // -> related.identifier
@OptionalParam(name = STU3_RELATED_ID) TokenOrListParam relatedId, // -> related
@OptionalParam(name = STU3_RELATED_REF) ReferenceOrListParam relatedRef, // Extension to ITI-67
@OptionalParam(name = IAnyResource.SP_RES_ID) TokenParam resourceId, @Sort SortSpec sortSpec, @IncludeParam Set<Include> includeSpec, RequestDetails requestDetails, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
// Be graceful and accept STU3 parameters as well
var dateParam = date != null ? date : indexed;
var categoryParam = category != null ? category : class_;
var securityLabelParam = securityLabel != null ? securityLabel : label;
// Handle "related" parameters
ReferenceOrListParam relatedParam = new ReferenceOrListParam();
TokenOrListParam relatedIdParam = new TokenOrListParam();
if (relatedRef != null) {
relatedParam = relatedRef;
} else if (relatedId != null) {
relatedIdParam = relatedId;
} else if (related != null) {
related.getValuesAsQueryTokens().stream().filter(referenceParam -> !DocumentReference.SP_IDENTIFIER.equals(referenceParam.getChain())).forEach(relatedParam::addOr);
related.getValuesAsQueryTokens().stream().filter(referenceParam -> DocumentReference.SP_IDENTIFIER.equals(referenceParam.getChain())).map(referenceParam -> referenceParam.toTokenParam(getFhirContext())).forEach(relatedIdParam::addOr);
}
var searchParameters = Iti67SearchParameters.builder().status(status).identifier(identifier).date(dateParam).category(categoryParam).type(type).setting(setting).period(period).facility(facility).event(event).securityLabel(securityLabelParam).format(format).related(relatedParam).relatedId(relatedIdParam)._id(resourceId).sortSpec(sortSpec).includeSpec(includeSpec).fhirContext(getFhirContext()).build();
searchParameters.setAuthor(author);
var patientChain = patient.getChain();
if (Patient.SP_IDENTIFIER.equals(patientChain)) {
searchParameters.setPatientIdentifier(patient.toTokenParam(getFhirContext()));
} else if (patientChain == null || patientChain.isEmpty()) {
searchParameters.setPatientReference(patient);
}
// Run down the route
return requestBundleProvider(null, searchParameters, ResourceType.DocumentReference.name(), httpServletRequest, httpServletResponse, requestDetails);
}
use of org.hl7.fhir.r4.model.Identifier in project BridgeServer2 by Sage-Bionetworks.
the class CRCControllerTest method makeProcedureRequest.
private String makeProcedureRequest() {
ProcedureRequest procedure = new ProcedureRequest();
Identifier id = new Identifier();
id.setSystem(USER_ID_VALUE_NS);
id.setValue(TEST_USER_ID);
Reference ref = new Reference();
ref.setIdentifier(id);
procedure.setSubject(ref);
return FHIR_CONTEXT.newJsonParser().encodeResourceToString(procedure);
}
Aggregations