CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG
1.0.0 - Release 1

CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG - Downloaded Version 1.0.0 See the Directory of published versions

## : Shared Resource Creation - JSON Representation

Page standards status: Trial-use | Maturity Level: 1

Raw json | Download

    {
      "resourceType" : "Library",
      "id" : "SharedResourceCreation",
      "text" : {
        "status" : "extensions",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<div>\n    <table class=\"grid dict\">\n        \n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Id: </b></th>\n            <td style=\"padding-left: 4px;\">SharedResourceCreation</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Version: </b></th>\n            <td style=\"padding-left: 4px;\">1.0.0</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Url: </b></th>\n            <td style=\"padding-left: 4px;\"><a href=\"Library-SharedResourceCreation.html\">SharedResourceCreation</a></td>\n        </tr>\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Status: </b></th>\n            <td style=\"padding-left: 4px;\">draft</td>\n        </tr>\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Type: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                    \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>system: </b> <span><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-library-type.html\">http://terminology.hl7.org/CodeSystem/library-type</a></span>\n                        </p>\n                        \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>code: </b> <span>logic-library</span>\n                        </p>\n                        \n                        \n                    \n                \n                \n            </td>\n        </tr>\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Date: </b></th>\n            <td style=\"padding-left: 4px;\">2025-09-15 12:53:39-0400</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Publisher: </b></th>\n            <td style=\"padding-left: 4px;\">CDC National Healthcare Safety Network (NHSN)</td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Jurisdiction: </b></th>\n            <td style=\"padding-left: 4px;\">US</td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Related Artifacts: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                \n                \n                <p><b>Dependencies</b></p>\n                <ul>\n                  \n                    <li><a href=\"http://fhir.org/guides/cqf/common/4.0.1/4.0.1/Library-FHIR-ModelInfo.html\">http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1</a></li>\n                  \n                    <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</code></li>\n                  \n                </ul>\n                \n                \n                \n                \n                \n            </td>\n        </tr>\n        \n\n        \n\n        \n\n        \n        \n        <tr>\n          <td colspan=\"2\">\n            <table>\n              <tr><th><a id=\"cql-content\"><b>Content: </b></a> text/cql</th></tr>\n              <tr><td><pre><code class=\"language-cql\">library SharedResourceCreation version '0.1.010'\r\n\r\ninclude FHIRHelpers version '4.0.2'\r\n\r\nusing FHIR version '4.0.1'\r\n\r\ndefine function &quot;GetIdExtensions&quot;(domainResource DomainResource):\r\n  domainResource.extension E\r\n  where E.url.value = 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/link-original-resource-id-extension'\r\n  return E\r\n\r\ndefine function &quot;GetPatientExtensions&quot;(domainResource DomainResource):\r\n  domainResource.extension E\r\n  where E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'\r\n    or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'\r\n    or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex'\r\n    or E.url.value = 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/link-original-resource-id-extension'\r\n  return E\r\n\r\ndefine function &quot;MetaElement&quot;(resource Resource, profileURLs List&lt;FHIR.canonical&gt;):\r\n  resource r\r\n  return FHIR.Meta{\r\n    extension: r.meta.extension,\r\n    versionId: r.meta.versionId,\r\n    lastUpdated: r.meta.lastUpdated,\r\n    profile: profileURLs,\r\n    security: r.meta.security,\r\n    tag: r.meta.tag\r\n  }\r\n\r\ndefine function ConditionStage(stage List&lt;FHIR.Condition.Stage&gt;):\r\n  stage s\r\n  return FHIR.Condition.Stage{\r\n    summary: s.summary,\r\n    assessment: s.assessment,\r\n    type: s.type\r\n  }\r\n\r\ndefine function ConditionEvidence(evidence List&lt;FHIR.Condition.Evidence&gt;):\r\n  evidence e\r\n  return FHIR.Condition.Evidence{\r\n    code: e.code,\r\n    detail: e.detail\r\n  }\r\n\r\ndefine function ConditionResource(condition Condition, profileURLs List&lt;FHIR.canonical&gt;, acceptedCategories List&lt;System.Code&gt;):\r\n  condition c\r\n  return Condition{\r\n    id: FHIR.id {value: 'LCR-' + c.id},\r\n    meta: MetaElement(c, profileURLs),\r\n    extension: c.extension,\r\n    clinicalStatus: c.clinicalStatus,\r\n    verificationStatus: c.verificationStatus,\r\n    category: c.category,\r\n    severity: c.severity,\r\n    code: c.code,\r\n    bodySite: c.bodySite,\r\n    subject: c.subject,\r\n    encounter: c.encounter,\r\n    onset: c.onset,\r\n    abatement: c.abatement,\r\n    recordedDate: c.recordedDate,\r\n    stage: ConditionStage(c.stage),\r\n    evidence: ConditionEvidence(c.evidence),\r\n    note: c.note\r\n  }\r\n\r\ndefine function CoverageClass(class List&lt;FHIR.Coverage.Class&gt;):\r\n  class c\r\n  return FHIR.Coverage.Class{\r\n    value: c.value,\r\n    name: c.name\r\n  }\r\n\r\ndefine function CoverageResource(coverage Coverage, profileURLs List&lt;FHIR.canonical&gt;):\r\n  coverage c\r\n  return Coverage{\r\n    id: FHIR.id{value: 'LCR-' + c.id},\r\n    meta: MetaElement(c, profileURLs),\r\n    extension: c.extension,\r\n    status: c.status,\r\n    type: c.type,\r\n    policyHolder: c.policyHolder,\r\n    subscriber: c.subscriber,\r\n    subscriberId: c.subscriberId,\r\n    beneficiary: c.beneficiary,\r\n    dependent: c.dependent,\r\n    relationship: c.relationship,\r\n    period: c.period,\r\n    payor: c.payor,\r\n    class: CoverageClass(c.class),\r\n    order: c.order,\r\n    network: c.network,\r\n    subrogation: c.subrogation,\r\n    contract: c.contract\r\n  }\r\n\r\ndefine function DiagnosticReportCoding(coding List&lt;Coding&gt;):\r\n  coding c\r\n  return Coding{\r\n    system: c.system,\r\n    version: c.version,\r\n    code: c.code,\r\n    display: c.display,\r\n    userSelected: c.userSelected\r\n  }\r\n\r\ndefine function DiagnosticReportCategory(category List&lt;CodeableConcept&gt;):\r\n  category c\r\n  return CodeableConcept{\r\n    coding: DiagnosticReportCoding(c.coding)\r\n  }\r\n\r\ndefine function DiagnosticReportLabResource(diagnosticReport DiagnosticReport, profileURLs List&lt;FHIR.canonical&gt;):\r\n  diagnosticReport d\r\n  return DiagnosticReport{\r\n    id: FHIR.id{value: 'LCR-' + d.id},\r\n    meta: MetaElement(d, profileURLs),\r\n    extension: d.extension,\r\n    basedOn: d.basedOn,\r\n    status: d.status,\r\n    category: DiagnosticReportCategory(d.category),\r\n    code: d.code,\r\n    subject: d.subject,\r\n    encounter: d.encounter,\r\n    effective: d.effective,\r\n    issued: d.issued,\r\n    performer: d.performer,\r\n    resultsInterpreter: d.resultsInterpreter,\r\n    specimen: d.specimen,\r\n    result: d.result,\r\n    conclusion: d.conclusion,\r\n    conclusionCode: d.conclusionCode\r\n  }\r\n\r\ndefine function EncounterIdentifier(identifier List&lt;FHIR.Identifier&gt;):\r\n  identifier i\r\n  return FHIR.Identifier{\r\n    use: i.use,\r\n    type: i.type,\r\n    system: i.system,\r\n    value: i.value,\r\n    period: i.period\r\n  }\r\n\r\ndefine function EncounterStatusHistory(statusHistory List&lt;FHIR.Encounter.StatusHistory&gt;):\r\n  statusHistory sH\r\n  return FHIR.Encounter.StatusHistory{\r\n    status: sH.status,\r\n    period: sH.period\r\n  }\r\n\r\ndefine function EncounterClassHistory(classHistory List&lt;FHIR.Encounter.ClassHistory&gt;):\r\n  classHistory cH\r\n  return FHIR.Encounter.ClassHistory{\r\n    class: cH.class,\r\n    period: cH.period\r\n  }\r\n\r\n/*No longer needed but saving for potential future use\r\ndefine function EncounterParticipant(participant List&lt;FHIR.Encounter.Participant&gt;):\r\n  participant p\r\n  return FHIR.Encounter.Participant{\r\n    type: p.type,\r\n    period: p.period,\r\n    individual: p.individual\r\n  }*/\r\n\r\ndefine function EncounterDiagnosis(diagnosis List&lt;FHIR.Encounter.Diagnosis&gt;):\r\n  diagnosis d\r\n  return FHIR.Encounter.Diagnosis{\r\n    condition: d.condition,\r\n    use: d.use,\r\n    rank: d.rank\r\n  }\r\n\r\ndefine function EncounterHospitalization(hospitalization FHIR.Encounter.Hospitalization):\r\n  hospitalization h\r\n  return FHIR.Encounter.Hospitalization{\r\n    preAdmissionIdentifier: h.preAdmissionIdentifier,\r\n    origin: h.origin,\r\n    admitSource: h.admitSource,\r\n    reAdmission: h.reAdmission,\r\n    dietPreference: h.dietPreference,\r\n    specialCourtesy: h.specialCourtesy,\r\n    specialArrangement: h.specialArrangement,\r\n    destination: h.destination,\r\n    dischargeDisposition: h.dischargeDisposition\r\n  }\r\n\r\ndefine function EncounterLocation(location List&lt;FHIR.Encounter.Location&gt;):\r\n  location l\r\n  return FHIR.Encounter.Location{\r\n    location: l.location,\r\n    status: l.status,\r\n    physicalType: l.physicalType,\r\n    period: l.period\r\n  }\r\n\r\ndefine function EncounterResource(encounter Encounter, profileURLs List&lt;FHIR.canonical&gt;):\r\n  encounter e\r\n  return Encounter{\r\n    id: FHIR.id{value: 'LCR-' + e.id},\r\n    meta: MetaElement(e, profileURLs),\r\n    extension: e.extension,\r\n    identifier: EncounterIdentifier(e.identifier),\r\n    status: e.status,\r\n    statusHistory: EncounterStatusHistory(e.statusHistory),\r\n    class: e.class,\r\n    classHistory: EncounterClassHistory(e.classHistory),\r\n    type: e.type,\r\n    serviceType: e.serviceType,\r\n    priority: e.priority,\r\n    subject: e.subject,\r\n    period: e.period,\r\n    length: e.length,\r\n    reasonCode: e.reasonCode,\r\n    reasonReference: e.reasonReference,\r\n    diagnosis: EncounterDiagnosis(e.diagnosis),\r\n    account: e.account,\r\n    hospitalization: EncounterHospitalization(e.hospitalization),\r\n    location: EncounterLocation(e.location),\r\n    partOf: e.partOf\r\n  }\r\n\r\ndefine function ObservationLabCoding(coding List&lt;Coding&gt;):\r\n  coding c\r\n  return Coding{\r\n    id: c.id,\r\n    extension: c.extension,\r\n    system: c.system,\r\n    version: c.version,\r\n    code: c.code,\r\n    display: c.display,\r\n    userSelected: c.userSelected\r\n  }\r\n\r\ndefine function ObservationLabCategory(category List&lt;CodeableConcept&gt;):\r\n  category c\r\n  return CodeableConcept{\r\n    coding: ObservationLabCoding(c.coding),\r\n    text: c.text\r\n  }\r\n\r\ndefine function ObservationReferenceRange(referenceRange List&lt;FHIR.Observation.ReferenceRange&gt;):\r\n  referenceRange rR\r\n  return FHIR.Observation.ReferenceRange{\r\n    low: rR.low,\r\n    high: rR.high,\r\n    type: rR.type,\r\n    appliesTo: rR.appliesTo,\r\n    age: rR.age,\r\n    text: rR.text\r\n  }\r\n\r\ndefine function ObservationComponent(component List&lt;FHIR.Observation.Component&gt;):\r\n  component c\r\n  return FHIR.Observation.Component{\r\n    code: c.code,\r\n    value: c.value,\r\n    dataAbsentReason: c.dataAbsentReason,\r\n    interpretation: c.interpretation,\r\n    referenceRange: c.referenceRange\r\n  }\r\n\r\ndefine function ObservationLabResource(observation Observation, profileURLs List&lt;FHIR.canonical&gt;):\r\n  observation o\r\n  return Observation{\r\n    id: FHIR.id {value: 'LCR-' + o.id},\r\n    meta: MetaElement(o, profileURLs),\r\n    extension: o.extension,\r\n    basedOn: o.basedOn,\r\n    partOf: o.partOf,\r\n    status: o.status,\r\n    category: ObservationLabCategory(o.category),\r\n    code: o.code,\r\n    subject: o.subject,\r\n    focus: o.focus,\r\n    encounter: o.encounter,\r\n    effective: o.effective,\r\n    issued: o.issued,\r\n    performer: o.performer,\r\n    value: o.value,\r\n    dataAbsentReason: o.dataAbsentReason,\r\n    interpretation: o.interpretation,\r\n    note: o.note,\r\n    bodySite: o.bodySite,\r\n    method: o.method,\r\n    specimen: o.specimen,\r\n    device: o.device,\r\n    referenceRange: ObservationReferenceRange(o.referenceRange),\r\n    hasMember: o.hasMember,\r\n    derivedFrom: o.derivedFrom,\r\n    component: ObservationComponent(o.component)\r\n  }\r\n\r\ndefine function LocationAddress(address FHIR.Address):\r\n  address a\r\n  return FHIR.Address{\r\n    use: a.use,\r\n    type: a.type,\r\n    text: a.text,\r\n    line: a.line,\r\n    city: a.city,\r\n    district: a.district,\r\n    state: a.state,\r\n    postalCode: a.postalCode,\r\n    country: a.country,\r\n    period: a.period\r\n  }\r\n\r\ndefine function LocationPosition(position FHIR.Location.Position):\r\n  position p\r\n  return FHIR.Location.Position{\r\n    longitude: p.longitude,\r\n    latitude: p.latitude,\r\n    altitude: p.altitude\r\n  }\r\n\r\ndefine function LocationHoursOfOperation(hoursOfOperation List&lt;FHIR.Location.HoursOfOperation&gt;):\r\n  hoursOfOperation hOO\r\n  return FHIR.Location.HoursOfOperation{\r\n    daysOfWeek: hOO.daysOfWeek,\r\n    allDay: hOO.allDay,\r\n    openingTime: hOO.openingTime,\r\n    closingTime: hOO.closingTime\r\n  }\r\n\r\ndefine function LocationResource(location Location, profileURLs List&lt;FHIR.canonical&gt;):\r\n  location l\r\n  return Location{\r\n    id: FHIR.id {value: 'LCR-' + l.id},\r\n    meta: MetaElement(l, profileURLs),\r\n    extension: l.extension,\r\n    status: l.status,\r\n    operationalStatus: l.operationalStatus,\r\n    name: l.name,\r\n    alias: l.alias,\r\n    description: l.description,\r\n    mode: l.mode,\r\n    type: l.type,\r\n    telecom: l.telecom,\r\n    address: LocationAddress(l.address),\r\n    physicalType: l.physicalType,\r\n    position: LocationPosition(l.position),\r\n    managingOrganization: l.managingOrganization,\r\n    partOf: l.partOf,\r\n    hoursOfOperation: LocationHoursOfOperation(l.hoursOfOperation),\r\n    availabilityExceptions: l.availabilityExceptions,\r\n    endpoint: l.endpoint\r\n  }\r\n\r\ndefine function MedicationIngredient(ingredient List&lt;FHIR.Medication.Ingredient&gt;):\r\n  ingredient i\r\n  return FHIR.Medication.Ingredient{\r\n    item: i.item,\r\n    strength: i.strength\r\n  }\r\n\r\ndefine function MedicationBatch(batch FHIR.Medication.Batch):\r\n  batch b\r\n  return FHIR.Medication.Batch{\r\n    lotNumber: b.lotNumber,\r\n    expirationDate: b.expirationDate\r\n  }\r\n\r\ndefine function MedicationResource(medication Medication, profileURLs List&lt;FHIR.canonical&gt;):\r\n  medication m\r\n  return Medication{\r\n    id: FHIR.id {value: 'LCR-' + m.id},\r\n    meta: MetaElement(m, profileURLs),\r\n    extension: m.extension,\r\n    code: m.code,\r\n    status: m.status,\r\n    manufacturer: m.manufacturer,\r\n    form: m.form,\r\n    amount: m.amount,\r\n    ingredient: MedicationIngredient(m.ingredient),\r\n    batch: MedicationBatch(m.batch)\r\n  }\r\n\r\ndefine function MedicationAdministrationPerformer(performer List&lt;FHIR.MedicationAdministration.Performer&gt;):\r\n  performer p\r\n  return FHIR.MedicationAdministration.Performer{\r\n    function: p.function,\r\n    actor: p.actor\r\n  }\r\n\r\ndefine function MedicationAdministrationDosage(dosage FHIR.MedicationAdministration.Dosage):\r\n  dosage d\r\n  return FHIR.MedicationAdministration.Dosage{\r\n    text: d.text,\r\n    site: d.site,\r\n    route: d.route,\r\n    method: d.method,\r\n    dose: d.dose,\r\n    rate: d.rate\r\n  }\r\n\r\ndefine function MedicationAdministrationResource(medicationAdministration MedicationAdministration, profileURLs List&lt;FHIR.canonical&gt;):\r\n  medicationAdministration m\r\n  return MedicationAdministration{\r\n    id: FHIR.id {value: 'LCR-' + m.id},\r\n    meta: MetaElement(m, profileURLs),\r\n    extension: m.extension,\r\n    instantiates: m.instantiates,\r\n    partOf: m.partOf,\r\n    status: m.status,\r\n    statusReason: m.statusReason,\r\n    category: m.category,\r\n    medication: m.medication,\r\n    subject: m.subject,\r\n    context: m.context,\r\n    supportingInformation: m.supportingInformation,\r\n    effective: m.effective,\r\n    performer: MedicationAdministrationPerformer(m.performer),\r\n    reasonCode: m.reasonCode,\r\n    reasonReference: m.reasonReference,\r\n    request: m.request,\r\n    device: m.device,\r\n    note: m.note,\r\n    dosage: MedicationAdministrationDosage(m.dosage),\r\n    eventHistory: m.eventHistory\r\n  }\r\n\r\ndefine function MedicationRequestDoseAndRate(doseAndRate List&lt;FHIR.Dosage.DoseAndRate&gt;):\r\n  doseAndRate dR\r\n  return FHIR.Dosage.DoseAndRate{\r\n    type: dR.type,\r\n    dose: dR.dose,\r\n    rate: dR.rate\r\n  }\r\n\r\ndefine function MedicationRequestDosageInstruction(dosageInstruction List&lt;FHIR.Dosage&gt;):\r\n  dosageInstruction dI\r\n  return FHIR.Dosage{\r\n    text: dI.text,\r\n    patientInstruction: dI.patientInstruction,\r\n    timing: dI.timing,\r\n    asNeeded: dI.asNeeded,\r\n    site: dI.site,\r\n    route: dI.route,\r\n    method: dI.method,\r\n    doseAndRate: MedicationRequestDoseAndRate(dI.doseAndRate)\r\n  }\r\n\r\ndefine function MedicationRequestResource(medicationRequest MedicationRequest, profileURLs List&lt;FHIR.canonical&gt;):\r\n  medicationRequest m\r\n  return MedicationRequest{\r\n    id: FHIR.id {value: 'LCR-' + m.id},\r\n    meta: MetaElement(medicationRequest, profileURLs),\r\n    extension: m.extension,\r\n    status: m.status,\r\n    statusReason: m.statusReason,\r\n    intent: m.intent,\r\n    category: m.category,\r\n    priority: m.priority,\r\n    doNotPerform: m.doNotPerform,\r\n    reported: m.reported,\r\n    medication: m.medication,\r\n    subject: m.subject,\r\n    encounter: m.encounter,\r\n    authoredOn: m.authoredOn,\r\n    requester: m.requester,\r\n    recorder: m.recorder,\r\n    reasonCode: m.reasonCode,\r\n    reasonReference: m.reasonReference,\r\n    instantiatesCanonical: m.instantiatesCanonical,\r\n    instantiatesUri: m.instantiatesUri,\r\n    courseOfTherapyType: m.courseOfTherapyType,\r\n    dosageInstruction: MedicationRequestDosageInstruction(m.dosageInstruction)\r\n  }\r\n\r\n/* No longer needed but saving in case it's useful later\r\ndefine function PatientIdentifier(identifier List&lt;FHIR.Identifier&gt;):\r\n  identifier i\r\n  return FHIR.Identifier{\r\n    id: i.id,\r\n    extension: i.extension,\r\n    use: i.use,\r\n    type: i.type,\r\n    system: i.system,\r\n    value: i.value,\r\n    period: i.period,\r\n    assigner: i.assigner\r\n  }*/\r\n\r\ndefine function PatientName(name List&lt;FHIR.HumanName&gt;):\r\n  name n\r\n  return FHIR.HumanName{\r\n    id: n.id,\r\n    extension: n.extension,\r\n    use: n.use,\r\n    text: n.text,\r\n    family: n.family,\r\n    given: n.given,\r\n    prefix: n.prefix,\r\n    suffix: n.suffix,\r\n    period: n.period\r\n  }\r\n\r\ndefine function PatientTelecom(telecom List&lt;FHIR.ContactPoint&gt;):\r\n  telecom t\r\n  return FHIR.ContactPoint{\r\n    system: t.system,\r\n    value: t.value,\r\n    use: t.use,\r\n    rank: t.rank,\r\n    period: t.period\r\n  }\r\n\r\ndefine function PatientAddress(address List&lt;FHIR.Address&gt;):\r\n  address a\r\n  return FHIR.Address{\r\n    id: a.id,\r\n    extension: a.extension,\r\n    use: a.use,\r\n    type: a.type,\r\n    text: a.text,\r\n    line: a.line,\r\n    city: a.city,\r\n    district: a.district,\r\n    state: a.state,\r\n    postalCode: a.postalCode,\r\n    country: a.country,\r\n    period: a.period\r\n  }\r\n\r\ndefine function PatientContact(contact List&lt;FHIR.Patient.Contact&gt;):\r\n  contact c\r\n  return FHIR.Patient.Contact{\r\n    id: c.id,\r\n    extension: c.extension,\r\n    relationship: c.relationship,\r\n    name: c.name,\r\n    telecom: c.telecom,\r\n    address: c.address,\r\n    gender: c.gender,\r\n    organization: c.organization,\r\n    period: c.period\r\n  }\r\n\r\ndefine function PatientCommunication(communication List&lt;FHIR.Patient.Communication&gt;):\r\n  communication c\r\n  return FHIR.Patient.Communication{\r\n    id: c.id,\r\n    extension: c.extension,\r\n    language: c.language,\r\n    preferred: c.preferred\r\n  }\r\n\r\ndefine function PatientLink(link List&lt;FHIR.Patient.Link&gt;):\r\n  link l\r\n  return FHIR.Patient.Link{\r\n    id: l.id,\r\n    extension: l.extension,\r\n    modifierExtension: l.modifierExtension,\r\n    other: l.other,\r\n    type: l.type\r\n  }\r\n\r\ndefine function PatientResource(patient Patient, profileURLs List&lt;FHIR.canonical&gt;):\r\n  patient p\r\n  return Patient{\r\n    id: FHIR.id{value: 'LCR-' + p.id},\r\n    meta: MetaElement(p, profileURLs),\r\n    extension: GetPatientExtensions(p) union GetIdExtensions(p),\r\n    identifier: p.identifier,\r\n    active: p.active,\r\n    name: PatientName(p.name),\r\n    telecom: PatientTelecom(p.telecom),\r\n    gender: p.gender,\r\n    birthDate: p.birthDate,\r\n    deceased: p.deceased,\r\n    address: PatientAddress(p.address),\r\n    maritalStatus: p.maritalStatus,\r\n    multipleBirth: p.multipleBirth,\r\n    photo: p.photo,\r\n    contact: PatientContact(p.contact),\r\n    communication: PatientCommunication(p.communication),\r\n    generalPractitioner: p.generalPractitioner,\r\n    managingOrganization: p.managingOrganization,\r\n    link: PatientLink(p.link)\r\n  }\r\n\r\ndefine function ProcedurePerformer(performer List&lt;FHIR.Procedure.Performer&gt;):\r\n  performer p\r\n  return FHIR.Procedure.Performer{\r\n    function: p.function,\r\n    actor: p.actor,\r\n    onBehalfOf: p.onBehalfOf\r\n  }\r\n\r\ndefine function ProcedureFocalDevice(device List&lt;FHIR.Procedure.FocalDevice&gt;):\r\n  device d\r\n  return FHIR.Procedure.FocalDevice{\r\n    action: d.action,\r\n    manipulated: d.manipulated\r\n  }\r\n\r\ndefine function ProcedureResource(procedure Procedure, profileURLs List&lt;FHIR.canonical&gt;):\r\n  procedure p\r\n  return Procedure{\r\n    id: FHIR.id {value: 'LCR-' + p.id},\r\n    meta: MetaElement(p, profileURLs),\r\n    extension: p.extension,\r\n    instantiatesCanonical: p.instantiatesCanonical,\r\n    instantiatesUri: p.instantiatesUri,\r\n    basedOn: p.basedOn,\r\n    partOf: p.partOf,\r\n    status: p.status,\r\n    statusReason: p.statusReason,\r\n    category: p.category,\r\n    code: p.code,\r\n    subject: p.subject,\r\n    encounter: p.encounter,\r\n    performed: p.performed,\r\n    recorder: p.recorder,\r\n    asserter: p.asserter,\r\n    performer: ProcedurePerformer(p.performer),\r\n    location: p.location,\r\n    reasonCode: p.reasonCode,\r\n    reasonReference: p.reasonReference,\r\n    bodySite: p.bodySite,\r\n    outcome: p.outcome,\r\n    report: p.report,\r\n    complication: p.complication,\r\n    complicationDetail: p.complicationDetail,\r\n    followUp: p.followUp,\r\n    note: p.note,\r\n    focalDevice: ProcedureFocalDevice(p.focalDevice),\r\n    usedReference: p.usedReference,\r\n    usedCode: p.usedCode\r\n  }\r\n\r\ndefine function ServiceRequestResource(serviceRequest ServiceRequest, profileURLs List&lt;FHIR.canonical&gt;):\r\n  serviceRequest sR\r\n  return ServiceRequest{\r\n    id: FHIR.id {value: 'LCR-' + sR.id},\r\n    meta: MetaElement(sR, profileURLs),\r\n    extension: sR.extension,\r\n    instantiatesCanonical: sR.instantiatesCanonical,\r\n    instantiatesUri: sR.instantiatesUri,\r\n    basedOn: sR.basedOn,\r\n    replaces: sR.replaces,\r\n    requisition: sR.requisition,\r\n    status: sR.status,\r\n    intent: sR.intent,\r\n    category: sR.category,\r\n    priority: sR.priority,\r\n    doNotPerform: sR.doNotPerform,\r\n    code: sR.code,\r\n    orderDetail: sR.orderDetail,\r\n    quantity: sR.quantity,\r\n    subject: sR.subject,\r\n    encounter: sR.encounter,\r\n    occurrence: sR.occurrence,\r\n    asNeeded: sR.asNeeded,\r\n    authoredOn: sR.authoredOn,\r\n    requester: sR.requester,\r\n    performerType: sR.performerType,\r\n    performer: sR.performer,\r\n    locationCode: sR.locationCode,\r\n    locationReference: sR.locationReference,\r\n    reasonCode: sR.reasonCode,\r\n    reasonReference: sR.reasonReference,\r\n    insurance: sR.insurance,\r\n    supportingInfo: sR.supportingInfo,\r\n    specimen: sR.specimen,\r\n    bodySite: sR.bodySite,\r\n    note: sR.note,\r\n    patientInstruction: sR.patientInstruction,\r\n    relevantHistory: sR.relevantHistory\r\n  }\r\n\r\ndefine function SpecimenCollection(collection FHIR.Specimen.Collection):\r\n  collection c\r\n  return FHIR.Specimen.Collection{\r\n    collector: c.collector,\r\n    collected: c.collected,\r\n    &quot;duration&quot;: c.&quot;duration&quot;,\r\n    quantity: c.quantity,\r\n    method: c.method,\r\n    bodySite: c.bodySite,\r\n    fastingStatus: c.fastingStatus\r\n  }\r\n\r\ndefine function SpecimenProcessing(processing List&lt;FHIR.Specimen.Processing&gt;):\r\n  processing p\r\n  return FHIR.Specimen.Processing{\r\n    description: p.description,\r\n    procedure: p.procedure,\r\n    additive: p.additive,\r\n    time: p.time\r\n  }\r\n\r\ndefine function SpecimenContainer(container List&lt;FHIR.Specimen.Container&gt;):\r\n  container c\r\n  return FHIR.Specimen.Container{\r\n    description: c.description,\r\n    type: c.type,\r\n    capacity: c.capacity,\r\n    specimenQuantity: c.specimenQuantity,\r\n    additive: c.additive\r\n  }\r\n\r\ndefine function SpecimenResource(specimen Specimen, profileURLs List&lt;FHIR.canonical&gt;):\r\n  specimen s\r\n  return Specimen{\r\n    id: FHIR.id {value: 'LCR-' + s.id},\r\n    meta: MetaElement(s, profileURLs),\r\n    extension: s.extension,\r\n    identifier: s.identifier,\r\n    accessionIdentifier: s.accessionIdentifier,\r\n    status: s.status,\r\n    type: s.type,\r\n    subject: s.subject,\r\n    receivedTime: s.receivedTime,\r\n    parent: s.parent,\r\n    request: s.request,\r\n    collection: SpecimenCollection(s.collection),\r\n    processing: SpecimenProcessing(s.processing),\r\n    container: SpecimenContainer(s.container),\r\n    condition: s.condition,\r\n    note: s.note\r\n  }\r\n\r\ndefine function &quot;OperationOutcomeResource&quot;(errorId String, resourceId FHIR.id, message String):\r\n  OperationOutcome{\r\n      id: FHIR.id{value: errorId},\r\n      issue: {\r\n          FHIR.OperationOutcome.Issue{\r\n          severity: FHIR.IssueSeverity{value: 'error'},\r\n          code: FHIR.IssueType{value: 'exception'},\r\n          details: \r\n              FHIR.CodeableConcept{\r\n                  coding: {\r\n                      Coding{\r\n                      system: uri{value: 'https://lantanagroup.com/validation-error'},\r\n                      code: code{value: 'Error'},\r\n                      display: string{value: 'Resource ' + resourceId + ' failed validation: ' + message}\r\n                      }\r\n                  }\r\n              }\r\n          }\r\n      }\r\n  }</code></pre></td></tr>\n            </table>\n          </td>\n        </tr>\n        \n        \n        \n    </table>\n</div>\n</div>"
      },
      "contained" : [
        {
          "resourceType" : "Parameters",
          "id" : "options",
          "parameter" : [
            {
              "name" : "translatorVersion",
              "valueString" : "3.25.0"
            },
            {
              "name" : "option",
              "valueString" : "EnableDateRangeOptimization"
            },
            {
              "name" : "option",
              "valueString" : "EnableAnnotations"
            },
            {
              "name" : "option",
              "valueString" : "EnableLocators"
            },
            {
              "name" : "option",
              "valueString" : "DisableListDemotion"
            },
            {
              "name" : "option",
              "valueString" : "DisableListPromotion"
            },
            {
              "name" : "analyzeDataRequirements",
              "valueBoolean" : false
            },
            {
              "name" : "collapseDataRequirements",
              "valueBoolean" : true
            },
            {
              "name" : "compatibilityLevel",
              "valueString" : "1.5"
            },
            {
              "name" : "enableCqlOnly",
              "valueBoolean" : false
            },
            {
              "name" : "errorLevel",
              "valueString" : "Info"
            },
            {
              "name" : "signatureLevel",
              "valueString" : "Overloads"
            },
            {
              "name" : "validateUnits",
              "valueBoolean" : true
            },
            {
              "name" : "verifyOnly",
              "valueBoolean" : false
            }
          ]
        }
      ],
      "extension" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions",
          "valueReference" : {
            "reference" : "#options"
          }
        }
      ],
      "url" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation",
      "version" : "1.0.0",
      "name" : "SharedResourceCreation",
      "status" : "draft",
      "type" : {
        "coding" : [
          {
            "system" : "http://terminology.hl7.org/CodeSystem/library-type",
            "code" : "logic-library"
          }
        ]
      },
      "date" : "2025-09-15T12:53:39-04:00",
      "publisher" : "CDC National Healthcare Safety Network (NHSN)",
      "contact" : [
        {
          "name" : "CDC National Healthcare Safety Network (NHSN)",
          "telecom" : [
            {
              "system" : "url",
              "value" : "http://www.cdc.gov/nhsn"
            },
            {
              "system" : "email",
              "value" : "nhsn@cdc.gov"
            }
          ]
        }
      ],
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "urn:iso:std:iso:3166",
              "code" : "US"
            }
          ]
        }
      ],
      "relatedArtifact" : [
        {
          "type" : "depends-on",
          "display" : "FHIR model information",
          "resource" : "http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"
        },
        {
          "type" : "depends-on",
          "display" : "Library FHIRHelpers",
          "resource" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2"
        }
      ],
      "content" : [
        {
          "contentType" : "text/cql",
          "data" : " "
        }
      ]
    }