use of org.hl7.fhir.dstu3.model.Device in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_device_example_pacemaker.
@Test
public void test_device_example_pacemaker() throws FileNotFoundException, IOException, Exception {
System.out.println("device-example-pacemaker.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\device-example-pacemaker.ttl"));
}
use of org.hl7.fhir.dstu3.model.Device in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_device_example_f001_feedingtube.
@Test
public void test_device_example_f001_feedingtube() throws FileNotFoundException, IOException, Exception {
System.out.println("device-example-f001-feedingtube.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\device-example-f001-feedingtube.ttl"));
}
use of org.hl7.fhir.dstu3.model.Device in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_device_example_ihe_pcd.
@Test
public void test_device_example_ihe_pcd() throws FileNotFoundException, IOException, Exception {
System.out.println("device-example-ihe-pcd.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\device-example-ihe-pcd.ttl"));
}
use of org.hl7.fhir.dstu3.model.Device in project CRD by HL7-DaVinci.
the class FhirBundleProcessor method createCriteriaList.
private List<CoverageRequirementRuleCriteria> createCriteriaList(CodeableConcept codeableConcept, List<Reference> insurance, List<Organization> payorList) {
try {
List<Coding> codings = codeableConcept.getCoding();
if (codings.size() > 0) {
logger.info("r4/FhirBundleProcessor::createCriteriaList: code[0]: " + codings.get(0).getCode() + " - " + codings.get(0).getSystem());
} else {
logger.info("r4/FhirBundleProcessor::createCriteriaList: empty codes list!");
}
List<Organization> payors = new ArrayList<>();
if (insurance != null) {
List<Coverage> coverages = insurance.stream().map(reference -> (Coverage) reference.getResource()).collect(Collectors.toList());
// Remove null coverages that may not have resolved.
coverages = coverages.stream().filter(coverage -> coverage != null).collect(Collectors.toList());
payors = Utilities.getPayors(coverages);
} else if (payorList != null) {
payors = payorList;
}
if (payors.size() > 0) {
logger.info("r4/FhirBundleProcessor::createCriteriaList: payer[0]: " + payors.get(0).getName());
} else {
// default to CMS if no payer was provided
logger.info("r4/FhirBundleProcessor::createCriteriaList: empty payers list, working around by adding CMS!");
Organization org = new Organization().setName("Centers for Medicare and Medicaid Services");
// how to get ID
org.setId("75f39025-65db-43c8-9127-693cdf75e712");
payors.add(org);
// remove the exception to use CMS if no payer is provided
// JIRA ticket https://jira.mitre.org/browse/DMEERX-894
// throw new RequestIncompleteException("No Payer found in coverage resource, cannot find documentation.");
}
List<CoverageRequirementRuleCriteria> criteriaList = CoverageRequirementRuleCriteria.createQueriesFromR4(codings, payors);
return criteriaList;
} catch (RequestIncompleteException e) {
// rethrow incomplete request exceptions
throw e;
} catch (Exception e) {
// catch all remaining exceptions
System.out.println(e);
throw new RequestIncompleteException("Unable to parse list of codes, codesystems, and payors from a device request.");
}
}
use of org.hl7.fhir.dstu3.model.Device in project CRD by HL7-DaVinci.
the class CrdRequestCreator method createOrderSignRequest.
/**
* Generate a order sign request that contains a ServiceRequest.
*
* @param patientGender Desired gender of the patient in the request
* @param patientBirthdate Desired birth date of the patient in the request
* @return Fully populated CdsRequest
*/
public static OrderSignRequest createOrderSignRequest(Enumerations.AdministrativeGender patientGender, Date patientBirthdate, String patientAddressState, String providerAddressState) {
OrderSignRequest request = new OrderSignRequest();
request.setHook(Hook.ORDER_SIGN);
request.setHookInstance(UUID.randomUUID().toString());
OrderSignContext context = new OrderSignContext();
request.setContext(context);
context.setUserId("Practitioner/1234");
Patient patient = createPatient(patientGender, patientBirthdate, patientAddressState);
context.setPatientId(patient.getId());
ServiceRequest sr = new ServiceRequest();
sr.setStatus(ServiceRequest.ServiceRequestStatus.DRAFT);
sr.setId("DeviceRequest/123");
sr.setIntent(ServiceRequest.ServiceRequestIntent.ORDER);
PrefetchCallback callback = (p, c) -> {
sr.addPerformer(new Reference(p));
sr.addInsurance(new Reference(c));
};
sr.setSubject(new Reference(patient));
Practitioner provider = createPractitioner();
Bundle prefetchBundle = createPrefetchBundle(patient, provider, callback, providerAddressState);
Coding oxygen = new Coding().setCode("A0426").setSystem("https://bluebutton.cms.gov/resources/codesystem/hcpcs").setDisplay("Ambulance service, advanced life support, non-emergency transport, level 1 (als 1)");
sr.setCode(new CodeableConcept().addCoding(oxygen).setText("Ambulance service Non-Emergency Transport"));
Bundle orderBundle = new Bundle();
Bundle.BundleEntryComponent bec = new Bundle.BundleEntryComponent();
bec.setResource(sr);
orderBundle.addEntry(bec);
Bundle.BundleEntryComponent pfDrBec = new Bundle.BundleEntryComponent();
pfDrBec.setResource(sr);
prefetchBundle.addEntry(pfDrBec);
context.setDraftOrders(orderBundle);
Device device = new Device();
device.setType(new CodeableConcept().addCoding(oxygen));
bec = new Bundle.BundleEntryComponent();
bec.setResource(device);
prefetchBundle.addEntry(bec);
CrdPrefetch prefetch = new CrdPrefetch();
prefetch.setServiceRequestBundle(prefetchBundle);
request.setPrefetch(prefetch);
return request;
}
Aggregations