/** * The main method here will directly call an open FHIR server and retrieve a * list of resources matching a given criteria, then load a linked resource. */ public static void main(String[] args) throws IOException { // Create a client factory FhirContext ctx = FhirContext.forDstu2(); // Create the client String serverBase = "http://fhir.healthintersections.com.au/open"; ClientInterface client = ctx.newRestfulClient(ClientInterface.class, serverBase); // Invoke the client to search for patient List<Patient> patients = client.findPatientsForMrn(new IdentifierDt("urn:oid:1.2.36.146.595.217.0.1", "12345")); System.out.println("Found " + patients.size() + " patients"); // Print a value from the loaded resource Patient patient = patients.get(0); System.out.println("Patient Last Name: " + patient.getName().get(0).getFamily().get(0).getValue()); // Load a referenced resource ResourceReferenceDt managingRef = patient.getManagingOrganization(); Organization org = (Organization) managingRef.loadResource(client); // Print organization name System.out.println(org.getName()); }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * Id for specimen * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * The Response business identifier * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * Business identifier which may be used by other parties to reference or identify the prescription. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * Identifiers assigned to this order by the orderer or by the receiver. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * Other identifiers for the study * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * Unique identifier for the substance * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * The Response business identifier * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Sets the SSN criterion. * * @param ssn SSN. */ public void setSSN(String ssn) { this.ssn = new IdentifierDt("http://hl7.org/fhir/sid/us-ssn", ssn); this.ssn.setType(IdentifierTypeCodesEnum.SS); }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> () * * <p> * <b>Definition:</b> * Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number) * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * A unique identifier assigned to this particular recommendation record. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (id) * * <p> * <b>Definition:</b> * Unique code or number identifying the location to its users * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }
@SuppressWarnings("unused") public static void main(String[] args) throws DataFormatException, IOException { Patient patient = new Patient(); patient.addIdentifier().setUse(IdentifierUseEnum.OFFICIAL).setSystem("urn:fake:mrns").setValue("7000135"); patient.addIdentifier().setUse(IdentifierUseEnum.SECONDARY).setSystem("urn:fake:otherids").setValue("3287486"); patient.addName().addFamily("Smith").addGiven("John").addGiven("Q").addSuffix("Junior"); patient.setGender(AdministrativeGenderEnum.MALE); FhirContext ctx = FhirContext.forDstu2(); String xmlEncoded = ctx.newXmlParser().encodeResourceToString(patient); String jsonEncoded = ctx.newJsonParser().encodeResourceToString(patient); MyClientInterface client = ctx.newRestfulClient(MyClientInterface.class, "http://foo/fhir"); IdentifierDt searchParam = new IdentifierDt("urn:someidentifiers", "7000135"); List<Patient> clients = client.findPatientsByIdentifier(searchParam); }
/** * Sets the MRN criterion. * * @param mrn MRN. */ public void setMRN(String mrn) { this.mrn = new IdentifierDt(); this.mrn.setType(IdentifierTypeCodesEnum.MR); this.mrn.setValue(mrn); }
/** * Sets the SSN criterion. * * @param ssn SSN. */ public void setSSN(String ssn) { this.ssn = new IdentifierDt(); this.ssn.setType(IdentifierTypeCodesEnum.SS); this.ssn.setValue(ssn); this.ssn.setSystem("http://hl7.org/fhir/sid/us-ssn"); }
/** * Sets the DEA criterion. * * @param dea DEA. */ @SuppressWarnings("unchecked") public void setDEA(String dea) { this.dea = new IdentifierDt(); CodeableConceptDt type = new CodeableConceptDt(null, "DEA"); this.dea.setType((BoundCodeableConceptDt<IdentifierTypeCodesEnum>) type); this.dea.setValue(dea); }