public static org.hl7.fhir.r4.model.StructureMap convertStructureMap(org.hl7.fhir.dstu2016may.model.StructureMap src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.StructureMap tgt = new org.hl7.fhir.r4.model.StructureMap(); copyDomainResource(src, tgt); tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); tgt.setStatus(convertConformanceResourceStatus(src.getStatus())); for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); for (org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContactComponent t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) if (isJurisdiction(t)) tgt.addJurisdiction(convertCodeableConcept(t)); else tgt.addUseContext(convertCodeableConceptToUsageContext(t)); if (src.hasRequirements()) tgt.setPurpose(src.getRequirements()); if (src.hasCopyright())
public static org.hl7.fhir.dstu2016may.model.StructureMap convertStructureMap(org.hl7.fhir.r4.model.StructureMap src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.StructureMap tgt = new org.hl7.fhir.dstu2016may.model.StructureMap(); copyDomainResource(src, tgt); tgt.setUrl(src.getUrl()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); tgt.setStatus(convertConformanceResourceStatus(src.getStatus())); for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); if (src.hasExperimental()) tgt.setExperimental(src.getExperimental()); if (src.hasPublisher()) tgt.setPublisher(src.getPublisher()); for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertStructureMapContactComponent(t)); if (src.hasDate()) tgt.setDate(src.getDate()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(convertCodeableConcept(t.getValueCodeableConcept())); for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(convertCodeableConcept(t)); if (src.hasPurpose()) tgt.setRequirements(src.getPurpose()); if (src.hasCopyright())
/** * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist */ public Identifier getIdentifierFirstRep() { if (getIdentifier().isEmpty()) { addIdentifier(); } return getIdentifier().get(0); }
/** * @return The first repetition of repeating field {@link #structure}, creating it if it does not already exist */ public StructureMapStructureComponent getStructureFirstRep() { if (getStructure().isEmpty()) { addStructure(); } return getStructure().get(0); }
/** * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist */ public CodeableConcept getJurisdictionFirstRep() { if (getJurisdiction().isEmpty()) { addJurisdiction(); } return getJurisdiction().get(0); }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("url")) { this.url = castToUri(value); // UriType } else if (name.equals("identifier")) { this.getIdentifier().add(castToIdentifier(value)); } else if (name.equals("version")) { this.version = castToString(value); // StringType } else if (name.equals("name")) { this.name = castToString(value); // StringType } else if (name.equals("title")) { this.title = castToString(value); // StringType } else if (name.equals("status")) { value = new PublicationStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<PublicationStatus> } else if (name.equals("experimental")) { this.experimental = castToBoolean(value); // BooleanType } else if (name.equals("date")) { this.date = castToDateTime(value); // DateTimeType } else if (name.equals("publisher")) { this.publisher = castToString(value); // StringType } else if (name.equals("contact")) { this.getContact().add(castToContactDetail(value)); } else if (name.equals("description")) { this.description = castToMarkdown(value); // MarkdownType } else if (name.equals("useContext")) { this.getUseContext().add(castToUsageContext(value)); } else if (name.equals("jurisdiction")) { this.getJurisdiction().add(castToCodeableConcept(value)); } else if (name.equals("purpose")) {
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 116079: return getUrlElement(); case -1618432855: return addIdentifier(); case 351608024: return getVersionElement(); case 3373707: return getNameElement(); case 110371416: return getTitleElement(); case -892481550: return getStatusElement(); case -404562712: return getExperimentalElement(); case 3076014: return getDateElement(); case 1447404028: return getPublisherElement(); case 951526432: return addContact(); case -1724546052: return getDescriptionElement(); case -669707736: return addUseContext(); case -507075711: return addJurisdiction(); case -220463842: return getPurposeElement(); case 1522889671: return getCopyrightElement(); case 144518515: return addStructure(); case -1184795739: return addImportElement(); case 98629247: return addGroup(); default: return super.makeProperty(hash, name); } }
profile.setBaseDefinition(prop.getBaseProperty().getStructure().getUrl()); profile.setName("Profile for "+profile.getType()+" for "+sliceName); profile.setUrl(map.getUrl().replace("StructureMap", "StructureDefinition")+"-"+profile.getType()+suffix); ctxt.setUserData("profile", profile.getUrl()); // then we can easily assign this profile url for validation later when we actually transform profile.setId(map.getId()+"-"+profile.getType()+suffix); profile.setStatus(map.getStatus()); profile.setExperimental(map.getExperimental()); profile.setDescription("Generated automatically from the mapping by the Java Reference Implementation"); for (ContactDetail c : map.getContact()) { ContactDetail p = profile.addContact(); p.setName(c.getName()); p.addTelecom(cc); profile.setDate(map.getDate()); profile.setCopyright(map.getCopyright()); profile.setFhirVersion(FHIRVersion.fromCode(Constants.VERSION)); profile.setKind(prop.getBaseProperty().getStructure().getKind());
return addIdentifier(); return addContact(); return addUseContext(); return addJurisdiction(); return addStructure(); return addGroup();
public StructureMap parse(String text, String srcName) throws FHIRException { FHIRLexer lexer = new FHIRLexer(text, srcName); if (lexer.done()) throw lexer.error("Map Input cannot be empty"); lexer.skipComments(); lexer.token("map"); StructureMap result = new StructureMap(); result.setUrl(lexer.readConstant("url")); lexer.token("="); result.setName(lexer.readConstant("name")); lexer.skipComments(); while (lexer.hasToken("conceptmap")) parseConceptMap(result, lexer); while (lexer.hasToken("uses")) parseUses(result, lexer); while (lexer.hasToken("imports")) parseImports(result, lexer); while (!lexer.done()) { parseGroup(result, lexer); } return result; }
/** * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist */ public ContactDetail getContactFirstRep() { if (getContact().isEmpty()) { addContact(); } return getContact().get(0); }
/** * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist */ public UsageContext getUseContextFirstRep() { if (getUseContext().isEmpty()) { addUseContext(); } return getUseContext().get(0); }
public StructureMap copy() { StructureMap dst = new StructureMap(); copyValues(dst); dst.url = url == null ? null : url.copy(); if (identifier != null) {
return new AppointmentResponse(); if ("StructureMap".equals(name)) return new StructureMap(); if ("AdverseEvent".equals(name)) return new AdverseEvent();
private void parseImports(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("imports"); result.addImport(lexer.readConstant("url")); lexer.skipToken(";"); if (lexer.hasComment()) { lexer.next(); } lexer.skipComments(); }
private void parseUses(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("uses"); StructureMapStructureComponent st = result.addStructure(); st.setUrl(lexer.readConstant("url")); if (lexer.hasToken("alias")) { lexer.token("alias"); st.setAlias(lexer.take()); } lexer.token("as"); st.setMode(StructureMapModelMode.fromCode(lexer.take())); lexer.skipToken(";"); if (lexer.hasComment()) { st.setDocumentation(lexer.take().substring(2).trim()); } lexer.skipComments(); }
private void parseGroup(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("group"); StructureMapGroupComponent group = result.addGroup(); boolean newFmt = false; if (lexer.hasToken("for")) {
switch (hash) { case 116079: // url this.url = castToUri(value); // UriType return value; case -1618432855: // identifier this.getIdentifier().add(castToIdentifier(value)); // Identifier return value; case 351608024: // version this.version = castToString(value); // StringType return value; case 3373707: // name this.name = castToString(value); // StringType return value; case 110371416: // title this.title = castToString(value); // StringType return value; case -892481550: // status value = new PublicationStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<PublicationStatus> return value; case -404562712: // experimental this.experimental = castToBoolean(value); // BooleanType return value; case 3076014: // date this.date = castToDateTime(value); // DateTimeType return value; case 1447404028: // publisher this.publisher = castToString(value); // StringType return value;
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 116079: return getUrlElement(); case -1618432855: return addIdentifier(); case 351608024: return getVersionElement(); case 3373707: return getNameElement(); case 110371416: return getTitleElement(); case -892481550: return getStatusElement(); case -404562712: return getExperimentalElement(); case 3076014: return getDateElement(); case 1447404028: return getPublisherElement(); case 951526432: return addContact(); case -1724546052: return getDescriptionElement(); case -669707736: return addUseContext(); case -507075711: return addJurisdiction(); case -220463842: return getPurposeElement(); case 1522889671: return getCopyrightElement(); case 144518515: return addStructure(); case -1184795739: return addImportElement(); case 98629247: return addGroup(); default: return super.makeProperty(hash, name); } }