protected void makeDocument() throws Exception { composition = (Composition) ResourceFactory.createResource("Composition"); addReference(composition, "Composition", makeUUIDReference()); Element title = cda.getChild(doc, "title"); composition.setTitle(title.getTextContent()); if (cda.getChild(doc, "setId") != null) { feed.setId(convert.makeURIfromII(cda.getChild(doc, "id"))); composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "setId"))); } else composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "id"))); // well, we fall back to id composition.setDateElement(convert.makeDateTimeFromTS(cda.getChild(doc, "effectiveTime"))); composition.setType(convert.makeCodeableConceptFromCD(cda.getChild(doc, "code"))); composition.setConfidentiality(convertConfidentiality(cda.getChild(doc, "confidentialityCode"))); if (cda.getChild(doc, "confidentialityCode") != null) composition.setLanguage(cda.getChild(doc, "confidentialityCode").getAttribute("value")); // todo - fix streaming for this Element ee = cda.getChild(doc, "componentOf"); if (ee != null) ee = cda.getChild(ee, "encompassingEncounter"); if (ee != null) { Encounter visit = new Encounter(); for (Element e : cda.getChildren(ee, "id")) visit.getIdentifier().add(convert.makeIdentifierFromII(e)); visit.setPeriod(convert.makePeriodFromIVL(cda.getChild(ee, "effectiveTime"))); composition.getEvent().add(new Composition.CompositionEventComponent()); composition.getEvent().get(0).getCode().add(convert.makeCodeableConceptFromCD(cda.getChild(ee, "code"))); composition.getEvent().get(0).setPeriod(visit.getPeriod()); composition.getEvent().get(0).getDetail().add(Factory.makeReference(addReference(visit, "Encounter", makeUUIDReference()))); } // main todo: fill out the narrative, but before we can do that, we have to convert everything else }
/** * Returns an encounter instance based on the specified CCOW context. */ @Override protected Encounter fromCCOWContext(ContextItems contextItems) { Encounter encounter = null; try { encounter = new Encounter(); //TODO: Populate encounter object from context items. return encounter; } catch (Exception e) { log.error(e); return null; } }
/** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated public Encounter addEncounterTarget() { Encounter r = new Encounter(); if (this.encounterTarget == null) this.encounterTarget = new ArrayList<Encounter>(); this.encounterTarget.add(r); return r; }
/** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated public Encounter addEncounterTarget() { Encounter r = new Encounter(); if (this.encounterTarget == null) this.encounterTarget = new ArrayList<Encounter>(); this.encounterTarget.add(r); return r; }
ArrayList<Encounter> encounters=new ArrayList<Encounter>(); JSONArray array=new JSONArray(Result); for(int i=0;i<array.length();i++){ JSONObject elem=(JSONObject)array.get(i); Encounter encounter=new Encounter(); Encounter.Name=elem.getString("Name"); Encounter.Age=elem.getInt("Age"); Encounter.Address=elem.getString("Address"); encounters.add(encounter); }
public String getFindForm(Model model){ model.addAttribute("enctr",new Encounter()); return "AddLink"; } @RequestMapping(method=RequestMethod.POST) public String processFindForm(@ModelAttribute("enctr")Encounter encounter){ System.out.println(encounter.getSelectedLink()); return "AddLink";//"redirect:"+encounter.getSelectedLink(); } @ModelAttribute("addLinkOptions") public Map loadLinkOptions(){ LinkedHashMap<String, String> addLinks = new LinkedHashMap<String,String>(); addLinks.put("/thislink","New this"); addLinks.put("/thatlink","New that"); addLinks.put("/otherlink","New other thing"); return addLinks; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This alert is only relevant during the encounter.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Flag.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
if (this.partOfTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Encounter.partOf"); else if (Configuration.doAutoCreate()) this.partOfTarget = new Encounter(); // aa return this.partOfTarget; } /** * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) */ public Encounter setPartOfTarget(Encounter value) {
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care that the document content is associated with.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create DocumentReferenceContextComponent.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create NutritionOrder.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Immunization.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create VisionPrescription.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter that is the context in which this list was created.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ListResource.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) */ public Encounter getEncounterTarget() { if (this.encounterTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Composition.encounter"); else if (Configuration.doAutoCreate()) this.encounterTarget = new Encounter(); // aa return this.encounterTarget; }
/** * @param jCas ye olde ... * @param sourceData - * @param noteTime yyyyMMddhhmm. * @return fhir encounter. */ static private Encounter createEncounter( final JCas jCas, final SourceData sourceData, final String noteTime ) { String encounterId = CTAKES_ENCOUNTER_ID; if ( sourceData != null ) { final String sourceEncounterId = sourceData.getSourceEncounterId(); if ( sourceEncounterId != null ) { encounterId = sourceEncounterId; } } final Encounter encounter = new Encounter(); encounter.setId( FhirElementFactory.createId( jCas, encounterId, noteTime ) ); encounter.setStatus( Encounter.EncounterStatus.FINISHED ); return encounter; }
public org.hl7.fhir.dstu3.model.Encounter convertEncounter(org.hl7.fhir.instance.model.Encounter src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Encounter tgt = new org.hl7.fhir.dstu3.model.Encounter(); copyDomainResource(src, tgt); for (org.hl7.fhir.instance.model.Identifier t : src.getIdentifier())
public static void main(String[] args) { // Create an incomplete encounter (status is required) Encounter enc = new Encounter(); enc.addIdentifier().setSystem("http://acme.org/encNums").setValue("12345"); // Create a new validator FhirContext ctx = FhirContext.forDstu3(); FhirValidator validator = ctx.newValidator(); // Did we succeed? ValidationResult result = validator.validateWithResult(enc); System.out.println("Success: " + result.isSuccessful()); // What was the result OperationOutcome outcome = (OperationOutcome) result.toOperationOutcome(); IParser parser = ctx.newXmlParser().setPrettyPrint(true); System.out.println(parser.encodeResourceToString(outcome)); } }
public static void main(String[] args) { // Create an incomplete encounter (status is required) Encounter enc = new Encounter(); enc.addIdentifier().setSystem("http://acme.org/encNums").setValue("12345"); // Create a new validator FhirValidator validator = FhirContext.forDstu3().newValidator(); // Cache this object! Supplies structure definitions DefaultProfileValidationSupport support = new DefaultProfileValidationSupport(); // Create the validator FhirInstanceValidator module = new FhirInstanceValidator(support); validator.registerValidatorModule(module); // Did we succeed? IParser parser = FhirContext.forDstu3().newXmlParser().setPrettyPrint(true); System.out.println(parser.encodeResourceToString(validator.validateWithResult(enc).toOperationOutcome())); } }
public static Encounter create(Patient patient, Date date, Location location, String sc) { Encounter encounter = new Encounter(); Reference pat = new Reference(patient); encounter.setSubject(pat); Period period = new Period(); period.setStart(date); encounter.setPeriod(period); Reference loc = new Reference(location); EncounterLocationComponent encloc = encounter.addLocation(); encloc.setPeriod(period); encloc.setLocation(loc); CodeableConcept type = encounter.addType(); CodeableConcept cat = getServiceCategory(sc); type.setText(cat.getText()); type.getCoding().addAll(cat.getCoding()); return encounter; }
protected void makeDocument() throws Exception { composition = (Composition) ResourceFactory.createResource("Composition"); addReference(composition, "Composition", makeUUIDReference()); Element title = cda.getChild(doc, "title"); composition.setTitle(title.getTextContent()); if (cda.getChild(doc, "setId") != null) { feed.setId(convert.makeURIfromII(cda.getChild(doc, "id"))); composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "setId"))); } else composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "id"))); // well, we fall back to id composition.setDateElement(convert.makeDateTimeFromTS(cda.getChild(doc, "effectiveTime"))); composition.setType(convert.makeCodeableConceptFromCD(cda.getChild(doc, "code"))); composition.setConfidentiality(convertConfidentiality(cda.getChild(doc, "confidentialityCode"))); if (cda.getChild(doc, "confidentialityCode") != null) composition.setLanguage(cda.getChild(doc, "confidentialityCode").getAttribute("value")); // todo - fix streaming for this Element ee = cda.getChild(doc, "componentOf"); if (ee != null) ee = cda.getChild(ee, "encompassingEncounter"); if (ee != null) { Encounter visit = new Encounter(); for (Element e : cda.getChildren(ee, "id")) visit.getIdentifier().add(convert.makeIdentifierFromII(e)); visit.setPeriod(convert.makePeriodFromIVL(cda.getChild(ee, "effectiveTime"))); composition.getEvent().add(new Composition.CompositionEventComponent()); composition.getEvent().get(0).getCode().add(convert.makeCodeableConceptFromCD(cda.getChild(ee, "code"))); composition.getEvent().get(0).setPeriod(visit.getPeriod()); composition.getEvent().get(0).getDetail().add(Factory.makeReference(addReference(visit, "Encounter", makeUUIDReference()))); } // main todo: fill out the narrative, but before we can do that, we have to convert everything else }