use of org.hl7.fhir.r4.model.Endpoint in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeMessageHeaderMessageSourceComponent.
protected void composeMessageHeaderMessageSourceComponent(Complex parent, String parentType, String name, MessageHeader.MessageSourceComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "source", name, element, index);
if (element.hasNameElement())
composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
if (element.hasSoftwareElement())
composeString(t, "MessageHeader", "software", element.getSoftwareElement(), -1);
if (element.hasVersionElement())
composeString(t, "MessageHeader", "version", element.getVersionElement(), -1);
if (element.hasContact())
composeContactPoint(t, "MessageHeader", "contact", element.getContact(), -1);
if (element.hasEndpointElement())
composeUrl(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
}
use of org.hl7.fhir.r4.model.Endpoint in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeLocation.
protected void composeLocation(Complex parent, String parentType, String name, Location element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "Location", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Location", "identifier", element.getIdentifier().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "Location", "status", element.getStatusElement(), -1);
if (element.hasOperationalStatus())
composeCoding(t, "Location", "operationalStatus", element.getOperationalStatus(), -1);
if (element.hasNameElement())
composeString(t, "Location", "name", element.getNameElement(), -1);
for (int i = 0; i < element.getAlias().size(); i++) composeString(t, "Location", "alias", element.getAlias().get(i), i);
if (element.hasDescriptionElement())
composeString(t, "Location", "description", element.getDescriptionElement(), -1);
if (element.hasModeElement())
composeEnum(t, "Location", "mode", element.getModeElement(), -1);
for (int i = 0; i < element.getType().size(); i++) composeCodeableConcept(t, "Location", "type", element.getType().get(i), i);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Location", "telecom", element.getTelecom().get(i), i);
if (element.hasAddress())
composeAddress(t, "Location", "address", element.getAddress(), -1);
if (element.hasPhysicalType())
composeCodeableConcept(t, "Location", "physicalType", element.getPhysicalType(), -1);
if (element.hasPosition())
composeLocationLocationPositionComponent(t, "Location", "position", element.getPosition(), -1);
if (element.hasManagingOrganization())
composeReference(t, "Location", "managingOrganization", element.getManagingOrganization(), -1);
if (element.hasPartOf())
composeReference(t, "Location", "partOf", element.getPartOf(), -1);
for (int i = 0; i < element.getHoursOfOperation().size(); i++) composeLocationLocationHoursOfOperationComponent(t, "Location", "hoursOfOperation", element.getHoursOfOperation().get(i), i);
if (element.hasAvailabilityExceptionsElement())
composeString(t, "Location", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "Location", "endpoint", element.getEndpoint().get(i), i);
}
use of org.hl7.fhir.r4.model.Endpoint in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImagingManifestStudyComponent.
protected void composeImagingManifestStudyComponent(Complex parent, String parentType, String name, ImagingManifest.StudyComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "study", name, element, index);
if (element.hasUidElement())
composeOid(t, "ImagingManifest", "uid", element.getUidElement(), -1);
if (element.hasImagingStudy())
composeReference(t, "ImagingManifest", "imagingStudy", element.getImagingStudy(), -1);
for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "ImagingManifest", "endpoint", element.getEndpoint().get(i), i);
for (int i = 0; i < element.getSeries().size(); i++) composeImagingManifestSeriesComponent(t, "ImagingManifest", "series", element.getSeries().get(i), i);
}
use of org.hl7.fhir.r4.model.Endpoint in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeCapabilityStatementCapabilityStatementMessagingComponent.
protected void composeCapabilityStatementCapabilityStatementMessagingComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "messaging", name, element, index);
for (int i = 0; i < element.getEndpoint().size(); i++) composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(t, "CapabilityStatement", "endpoint", element.getEndpoint().get(i), i);
if (element.hasReliableCacheElement())
composeUnsignedInt(t, "CapabilityStatement", "reliableCache", element.getReliableCacheElement(), -1);
if (element.hasDocumentationElement())
composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
for (int i = 0; i < element.getSupportedMessage().size(); i++) composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(t, "CapabilityStatement", "supportedMessage", element.getSupportedMessage().get(i), i);
}
use of org.hl7.fhir.r4.model.Endpoint in project CRD by HL7-DaVinci.
the class CoverageRequirementsDiscoveryOperationHardCodedResponse method coverageRequirementsDiscovery.
/**
* Submits the CRD request.
* @param request the request to be submitted
* @param endpoint the endpoint to submit the request to
* @param requestQualification what kind of request it is
* @return the parameters returned from the server
*/
@Operation(name = "$coverage-requirements-discovery", idempotent = true)
public Parameters coverageRequirementsDiscovery(@OperationParam(name = "request") Parameters.ParametersParameterComponent request, @OperationParam(name = "endpoint") Endpoint endpoint, @OperationParam(name = "requestQualification") CodeableConcept requestQualification) {
logger.debug("coverageRequirementsDiscovery: start");
Parameters retVal = new Parameters();
CoverageEligibilityRequest eligibilityRequest = null;
Patient patient = null;
Coverage coverage = null;
Practitioner provider = null;
Organization insurer = null;
Location facility = null;
// supportingInformation
// serviceInformation
// grab the list of parameters
List<Parameters.ParametersParameterComponent> paramList = request.getPart();
// pull each of the parameters from the list
for (Parameters.ParametersParameterComponent part : paramList) {
System.out.println(part.getName());
switch(part.getName()) {
case "eligibilityrequest":
logger.debug("CRD: got eligibilityrequest");
eligibilityRequest = (CoverageEligibilityRequest) part.getResource();
break;
case "patient":
logger.debug("CRD: got patient");
patient = (Patient) part.getResource();
break;
case "coverage":
logger.debug("CRD: got coverage");
coverage = (Coverage) part.getResource();
break;
case "provider":
logger.debug("CRD: got provider");
provider = (Practitioner) part.getResource();
break;
case "insurer":
logger.debug("CRD: got insurer");
insurer = (Organization) part.getResource();
break;
case "facility":
logger.debug("CRD: got facility");
facility = (Location) part.getResource();
break;
case "patientContext":
ResourceType patientContextType = part.getResource().getResourceType();
switch(patientContextType) {
case Condition:
logger.debug("CRD: got request.patientContext of type Condition");
break;
case Device:
logger.debug("CRD: got request.patientContext of type Device");
break;
case Procedure:
logger.debug("CRD: got request.patientContext of type Procedure");
break;
case MedicationStatement:
logger.debug("CRD: got request.patientContext of type MedicationStatement");
break;
case HealthcareService:
logger.debug("CRD: got request.patientContext of type HealthcareService");
break;
default:
logger.warn("Warning: unexpected request.patientContext type");
break;
}
break;
case "serviceInformationReference":
ResourceType serviceInformationReferenceType = part.getResource().getResourceType();
switch(serviceInformationReferenceType) {
case Procedure:
logger.debug("CRD: got request.serviceInformationReferenceType of type Procedure");
break;
case HealthcareService:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type HealthcareService");
break;
case ServiceRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type ServiceRequest");
break;
case MedicationRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type MedicationRequest");
break;
case Medication:
logger.debug("CRD: got request.serviceInformationReferenceType of type Medication");
break;
case Device:
logger.debug("CRD: got request.serviceInformationReferenceType of type Device");
break;
case DeviceRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type DeviceRequest");
break;
default:
logger.warn("Warning: unexpected request.serviceInformationReferenceType type");
break;
}
break;
default:
logger.warn("Warning: unexpected parameter part: " + part.getName());
break;
}
}
// Note: if nothing is set in the reference (even if it was created) it will be null
if (nullCheck(eligibilityRequest, "eligibilityrequest") || nullCheck(patient, "patient") || nullCheck(coverage, "coverage") || nullCheck(provider, "provider") || nullCheck(insurer, "insurer")) {
logger.error("ERROR: required information missing!");
return retVal;
}
// print out the patient name
assert patient != null;
if (patient.hasName()) {
logger.debug("CRD: Patient Name: " + patient.getName().get(0).getText());
} else {
logger.debug("CRD: No Patient Name provided");
}
// start building the response
CoverageEligibilityResponse eligibilityResponse = new CoverageEligibilityResponse();
eligibilityResponse.setDisposition("this is a test");
Endpoint finalEndPoint = new Endpoint();
finalEndPoint.setAddress("http://www.mitre.org");
Parameters.ParametersParameterComponent response = retVal.addParameter();
response.setName("response");
response.addPart().setName("eligibilityresponse").setResource(eligibilityResponse);
response.addPart().setName("requestProvider").setResource(provider);
response.addPart().setName("request").setResource(eligibilityRequest);
response.addPart().setName("insurer").setResource(insurer);
response.addPart().setName("coverage").setResource(coverage);
// add a few service resources to the parameters
Procedure procedure = new Procedure();
procedure.setId("procedure-1");
Device device = new Device();
device.setModelNumber("LMNOP678");
response.addPart().setName("service").setResource(procedure);
response.addPart().setName("service").setResource(device);
if (finalEndPoint != null) {
response.addPart().setName("endPoint").setResource(finalEndPoint);
}
logger.debug("coverageRequirementsDiscovery: end");
return retVal;
}
Aggregations