@medplum/mock 5.1.24 → 5.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +2 -2
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var je=(c,n,e)=>n in c?A(c,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[n]=e;var Be=(c,n)=>{for(var e in n)A(c,e,{get:n[e],enumerable:!0})},Qe=(c,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ne(n))!Ue.call(c,i)&&i!==e&&A(c,i,{get:()=>n[i],enumerable:!(t=Le(n,i))||t.enumerable});return c};var ze=c=>Qe(A({},"__esModule",{value:!0}),c);var d=(c,n,e)=>je(c,typeof n!="symbol"?n+"":n,e);var st={};Be(st,{BartSimpson:()=>w,BlinkyTheFish:()=>Ve,DifferentOrganization:()=>ee,DrAliceSmith:()=>s,DrAliceSmithPreviousVersion:()=>te,DrAliceSmithSchedule:()=>k,ExampleAccessPolicy:()=>Z,ExampleAuditEvent:()=>Ke,ExampleBot:()=>ne,ExampleBotSourceCode:()=>_e,ExampleClient:()=>oe,ExampleQuestionnaire:()=>ae,ExampleQuestionnaireResponse:()=>re,ExampleStatusValueSet:()=>J,ExampleSubscription:()=>pe,ExampleThreadHeader:()=>U,ExampleThreadMessages:()=>ye,ExampleUserConfiguration:()=>Y,ExampleWorkflowPlanDefinition:()=>j,ExampleWorkflowQuestionnaire1:()=>v,ExampleWorkflowQuestionnaire2:()=>b,ExampleWorkflowQuestionnaire3:()=>S,ExampleWorkflowQuestionnaireResponse1:()=>B,ExampleWorkflowRequestGroup:()=>ve,ExampleWorkflowTask1:()=>Q,ExampleWorkflowTask2:()=>z,ExampleWorkflowTask3:()=>W,FishPatientResources:()=>rt,HomerBartRelatedPerson:()=>Me,HomerCommunication:()=>de,HomerDiagnosticReport:()=>me,HomerEncounter:()=>P,HomerLisaRelatedPerson:()=>Te,HomerMedia:()=>le,HomerObservation1:()=>C,HomerObservation2:()=>I,HomerObservation3:()=>q,HomerObservation4:()=>O,HomerObservation5:()=>H,HomerObservation6:()=>F,HomerObservation7:()=>V,HomerObservation8:()=>L,HomerServiceRequest:()=>N,HomerSimpson:()=>m,HomerSimpsonPreviousVersion:()=>he,HomerSimpsonSpecimen:()=>T,HomerSimpsonUSCorePatient:()=>Ye,ImplantableDeviceKnee:()=>Xe,LisaSimpson:()=>ce,MOCK_ALICE_PRACTITIONER_ID:()=>R,MOCK_HOMER_PATIENT_ID:()=>We,MOCK_TEST_ORGANIZATION_ID:()=>Ge,MargeSimpson:()=>Ae,MockClient:()=>De,MockFetchClient:()=>_,MockReconnectingWebSocket:()=>G,MockSubscriptionManager:()=>M,SimpsonsFamily:()=>$e,TestOrganization:()=>X,USCoreStructureDefinitionList:()=>Je,createFakeJwt:()=>Re,exampleValueSet:()=>ge,makeDrAliceSmithSlots:()=>ie});module.exports=ze(st);var r=require("@medplum/core"),$=require("@medplum/fhir-router");var We="123",R="124",Ge="125";var Z={resourceType:"AccessPolicy",id:"123",name:"Example Access Policy"},J={resourceType:"ValueSet",id:"example-statuses",status:"active",compose:{include:[{concept:[{code:"ORDERED"},{code:"SENT_TO_CUSTOMER"},{code:"SENT_BACK_TO_LAB"},{code:"LAB_PROCESSED"},{code:"LAB_COMPLETE"}]}]}},Y={resourceType:"UserConfiguration",id:"123",name:"Example User Configuration",option:[{id:"statusValueSet",valueString:"ValueSet/example-statuses"}]};var E=require("@medplum/core");var X={resourceType:"Organization",id:"125",meta:{versionId:"1"},name:"Test Organization"},ee={resourceType:"Organization",id:"456",meta:{versionId:"1"},name:"Different"},s={resourceType:"Practitioner",id:"124",meta:{versionId:"2",lastUpdated:"2021-01-02T12:00:00Z",author:{reference:`Practitioner/${"124"}`}},name:[{given:["Alice"],family:"Smith"}],photo:[{contentType:E.ContentType.PNG,url:"https://www.medplum.com/img/cdc-femaledoc.png"}]},te={resourceType:"Practitioner",id:"124",meta:{versionId:"1",lastUpdated:"2021-01-01T12:00:00Z",author:{reference:`Practitioner/${"124"}`}},name:[{given:["Medplum"],family:"Admin"}]},k={resourceType:"Schedule",id:"alice-smith-schedule",actor:[{reference:`Practitioner/${"124"}`,display:"Dr. Alice Smith"}]},ie=(0,E.lazy)(()=>{let c=(0,E.createReference)(k),n=[],e=new Date;for(let t=0;t<60;t++){for(let i of[9,10,11,13,14,15])e.setHours(i,0,0,0),n.push({resourceType:"Slot",id:`slot-${t}-${i}`,status:"free",start:e.toISOString(),end:new Date(e.getTime()+3600*1e3).toISOString(),schedule:c});e.setDate(e.getDate()+1)}return n});var _e={resourceType:"Binary",id:"bot-source-code",contentType:"application/javascript"},ne={resourceType:"Bot",id:"123",name:"Test Bot",sourceCode:{contentType:"application/javascript",title:"index.js",url:"Binary/bot-source-code"}},oe={resourceType:"ClientApplication",id:"123",name:"Test Client"};var Pe=require("@medplum/core");var ae={resourceType:"Questionnaire",id:"123",url:"https://example.com/example-questionnaire",status:"active",name:"Vitals",title:"Vitals",subjectType:["Patient"],item:[{linkId:"1",text:"First question",type:"string"}]},re={resourceType:"QuestionnaireResponse",id:"123",status:"completed",questionnaire:"https://example.com/example-questionnaire",subject:{reference:`Patient/${"123"}`},source:(0,Pe.createReference)(s)};var o=require("@medplum/core");var se={use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},ce={resourceType:"Patient",id:"lisa-simpson",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},birthDate:"1981-05-09",name:[{given:["Lisa"],family:"Simpson"}],photo:[{contentType:"image/jpeg",url:"https://example.com/picture.jpg"}],contact:[{name:{given:["Homer"],family:"Simpson"},address:{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"homer@thesimpsons.com"}]},{name:{given:["Marge"],family:"Simpson"},address:{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},telecom:[{system:"phone",use:"mobile",value:"139-1928"},{system:"email",use:"home",value:"marge@thesimpsons.com"}]}],telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"lisa@thesimpsons.com"}]},w={resourceType:"Patient",id:"555",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},birthDate:"1979-12-17",name:[{given:["Bart"],family:"Simpson"}],photo:[{contentType:"image/jpeg",url:"https://example.com/picture.jpg"}],telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"bart@thesimpsons.com"}]},Te={resourceType:"RelatedPerson",id:"homer-lisa-related-person",patient:(0,o.createReference)(ce),address:[se],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],relationship:[{text:"father",coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-RoleCode",code:"FTH",display:"father"}]}]},Me={resourceType:"RelatedPerson",id:"homer-bart-related-person",patient:(0,o.createReference)(w),address:[se],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],relationship:[{text:"father",coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-RoleCode",code:"FTH",display:"father"}]}]},m={resourceType:"Patient",id:"123",gender:"male",meta:{versionId:"2",lastUpdated:"2020-01-02T00:00:00.000Z",author:(0,o.createReference)(s)},identifier:[{system:"abc",value:"123"},{system:"def",value:"456"}],active:!0,birthDate:"1956-05-12",name:[{given:["Homer"],family:"Simpson"}],photo:[{contentType:o.ContentType.PNG,url:"https://www.medplum.com/img/homer-simpson.png"}],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],address:[{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"}],link:[{other:(0,o.createReference)(Te),type:"seealso"},{other:(0,o.createReference)(Me),type:"seealso"}]},Ae={resourceType:"Patient",id:"marge-simpson",gender:"female",active:!0,birthDate:"1961-08-23",name:[{given:["Marge"],family:"Simpson"}],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"margesimpson@aol.com"}],address:[se]},he={resourceType:"Patient",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-01T00:00:00.000Z",author:(0,o.createReference)(s)},name:[{given:["Homer"],family:"Simpson"}],photo:[{contentType:o.ContentType.PNG,url:"https://www.medplum.com/img/homer-simpson.png"}]},P={resourceType:"Encounter",id:"123",meta:{versionId:"456",lastUpdated:"2020-01-01T00:00:00.000Z",author:(0,o.createReference)(s)},status:"finished",class:{code:"AMB",display:"ambulatory"}},de={resourceType:"Communication",id:"123",meta:{lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},status:"completed",encounter:(0,o.createReference)(P),payload:[{contentString:"Hello world"}]},le={resourceType:"Media",id:"123",meta:{lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},status:"completed",encounter:(0,o.createReference)(P),content:{contentType:o.ContentType.TEXT,url:"data:text/plain,This%20is%20a%20text/plain%20data%20URL"}},C={resourceType:"Observation",id:"1",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{coding:[{code:"test",system:"http://example.com"}],text:"Test 1"},valueString:"test"},I={resourceType:"Observation",id:"2",status:"corrected",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 2"},valueQuantity:{value:20,unit:"x"},referenceRange:[{low:{value:10}}]},q={resourceType:"Observation",id:"3",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 3"},valueQuantity:{value:30,unit:"x"},referenceRange:[{high:{value:50}}]},O={resourceType:"Observation",id:"4",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 4"},valueQuantity:{value:50,unit:"x",comparator:">"},referenceRange:[{low:{value:10,unit:"x"},high:{value:50,unit:"x"}}],interpretation:[{text:"HIGH"}]},H={resourceType:"Observation",id:"5",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 5"},valueQuantity:{value:100,unit:"x"},referenceRange:[{}],interpretation:[{}]},F={resourceType:"Observation",id:"6",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 6"},component:[{code:{text:"Systolic"},valueQuantity:{value:110,unit:"mmHg",system:o.UCUM}},{code:{text:"Diastolic"},valueQuantity:{value:75,unit:"mmHg",system:o.UCUM}}]},V={resourceType:"Observation",id:"7",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 7"},component:[{code:{text:"Glucose"},valueQuantity:{value:1e3,unit:"mg/dL",system:o.UCUM}}],interpretation:[{coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",code:"HH",display:"Critical high"}]}]},L={resourceType:"Observation",id:"8",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 8"},component:[{code:{text:"HIV"},valueString:"REACTIVE"}],referenceRange:[{text:"NEGATIVE"}],interpretation:[{coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",code:"RR",display:"Reactive"}]}]},T={id:"123",resourceType:"Specimen",subject:(0,o.createReference)(m),collection:{collectedDateTime:"2020-01-01T12:00:00Z"},note:[{text:"Specimen hemolyzed. Results may be affected."},{text:"Specimen lipemic. Results may be affected."}]},N={resourceType:"ServiceRequest",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},identifier:[{system:"https://example.com",value:"9001"}],code:{coding:[{system:o.SNOMED,code:"SERVICE_REQUEST_CODE"}]},subject:{reference:"Patient/123",display:"Homer Simpson"},status:"active",intent:"order",orderDetail:[{text:"ORDERED"}],specimen:[(0,o.createReference)(T)],authoredOn:"2020-01-01T12:00:00Z"},me={resourceType:"DiagnosticReport",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-02T12:00:00Z",author:(0,o.createReference)(s)},status:"final",code:{text:"Test Report"},subject:(0,o.createReference)(m),basedOn:[(0,o.createReference)(N)],specimen:[(0,o.createReference)(T)],resultsInterpreter:[(0,o.createReference)(s)],result:[(0,o.createReference)(C),(0,o.createReference)(I),(0,o.createReference)(q),(0,o.createReference)(O),(0,o.createReference)(H),(0,o.createReference)(F),(0,o.createReference)(V),(0,o.createReference)(L)]},$e={resourceType:"Group",id:"simpsons-family",type:"person",actual:!0,member:[{entity:(0,o.createReference)(m)},{entity:(0,o.createReference)(Ae)},{entity:(0,o.createReference)(w)},{entity:(0,o.createReference)(ce)}]};var ue=require("@medplum/core");var pe={resourceType:"Subscription",id:"123",meta:{versionId:"456"},status:"active",reason:"Reason",criteria:"Criteria",channel:{type:"rest-hook",endpoint:"https://example.com"}},Ke={resourceType:"AuditEvent",id:"123",meta:{lastUpdated:new Date().toISOString(),versionId:"456",author:(0,ue.createReference)(s)},type:{system:"http://terminology.hl7.org/CodeSystem/audit-event-type",code:"rest-hook"},recorded:new Date().toISOString(),agent:[{requestor:!0,who:(0,ue.createReference)(s)}],source:{observer:{reference:"Device/123"}}};var y=require("@medplum/core");var U={id:"message-header-123",resourceType:"Communication",topic:{text:"Example Thread"},sender:(0,y.createReference)(s),recipient:[(0,y.createReference)(s),(0,y.createReference)(m)],sent:"2024-03-27T06:31:35Z",status:"in-progress"},ke={resourceType:"Communication",status:"completed",partOf:[(0,y.createReference)(U)]},fe={...ke,sender:(0,y.createReference)(s),recipient:[(0,y.createReference)(m)]},xe={...ke,sender:(0,y.createReference)(m),recipient:[(0,y.createReference)(s)]},ye=[{...fe,id:"message-1",payload:[{contentString:"Hi, Homer. Can you come in to discuss treatment for your radiation poisoning?"}],sent:"2024-03-27T06:31:35Z",received:"2024-03-27T06:31:39Z"},{...xe,id:"message-2",payload:[{contentString:"Aww, not again... Doh!"}],sent:"2024-03-27T06:32:35Z",received:"2024-03-27T06:32:39Z"},{...fe,id:"message-3",payload:[{contentString:"Homer, I haven't received your labs yet. Did you go for your lab work?"}],sent:"2024-03-27T06:35:35Z",received:"2024-03-27T06:36:35Z"},{...xe,payload:[{contentString:"Of course I did! Must be in the mail"}],sent:"2024-03-27T06:36:39Z",received:"2024-03-27T06:37:39Z"},{...fe,id:"message-5",payload:[{contentString:"Homer, this is for your own wellbeing. You need to take this seriously."}],sent:"2024-03-27T06:37:39Z",received:"2024-03-27T06:38:39Z"},{...xe,id:"message-6",status:"in-progress",payload:[{contentString:"Well I stopped eating donuts didn't I? Sometimes..."}],sent:"2024-03-27T06:38:42Z"}];var p=require("@medplum/core");var Ce=[{resourceType:"StructureDefinition",id:"us-core-patient",url:"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",version:"5.0.1",name:"USCorePatientProfile",title:"US Core Patient Profile",status:"active",experimental:!1,date:"2022-04-20T15:02:49-07:00",publisher:"HL7 International - Cross-Group Projects",contact:[{name:"HL7 International - Cross-Group Projects",telecom:[{system:"url",value:"http://www.hl7.org/Special/committees/cgp"},{system:"email",value:"cgp@lists.HL7.org"}]}],description:"The US Core Patient Profile meets the U.S. Core Data for Interoperability (USCDI) v2 'Patient Demographics' requirements. This profile sets minimum expectations for the Patient resource to record, search, and fetch basic demographics and other administrative information about an individual patient. It identifies which core elements, extensions, vocabularies and value sets **SHALL** be present in the resource when using this profile to promote interoperability and adoption through common implementation. It identifies which core elements, extensions, vocabularies and value sets **SHALL** be present in the resource when using this profile. It provides the floor for standards development for specific uses cases.",jurisdiction:[{coding:[{system:"urn:iso:std:iso:3166",code:"US"}]}],copyright:"Used by permission of HL7 International, all rights reserved Creative Commons License",fhirVersion:"4.0.1",kind:"resource",abstract:!1,type:"Patient",baseDefinition:"http://hl7.org/fhir/StructureDefinition/Patient",derivation:"constraint",snapshot:{element:[{id:"Patient",path:"Patient",short:"Information about an individual or animal receiving health care services",definition:"\\-",comment:"\\-",alias:["SubjectOfCare Client Resident"],min:0,max:"*",base:{path:"Patient",min:0,max:"*"},constraint:[{key:"dom-2",severity:"error",human:"If the resource is contained in another resource, it SHALL NOT contain nested Resources",expression:"contained.contained.empty()",xpath:"not(parent::f:contained and f:contained)",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-3",severity:"error",human:"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource",expression:"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()",xpath:"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-4",severity:"error",human:"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",expression:"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",xpath:"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-5",severity:"error",human:"If a resource is contained in another resource, it SHALL NOT have a security label",expression:"contained.meta.security.empty()",xpath:"not(exists(f:contained/*/f:meta/f:security))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{extension:[{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice",valueBoolean:!0},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation",valueMarkdown:"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],key:"dom-6",severity:"warning",human:"A resource should have narrative for robust management",expression:"text.`div`.exists()",xpath:"exists(f:text/h:div)",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"us-core-6",severity:"error",human:"Either Patient.name.given and/or Patient.name.family SHALL be present or a Data Absent Reason Extension SHALL be present.",expression:"(name.family.exists() or name.given.exists()) xor extension.where(url='http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()",xpath:"(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason' and not(/f:name/f:family or /f:name/f:given)) or (not(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason') and (/f:name/f:family or /f:name/f:given))"}],mustSupport:!1,isModifier:!1,isSummary:!1},{id:"Patient.id",path:"Patient.id",short:"Logical id of this artifact",definition:"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",comment:"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.",min:0,max:"1",base:{path:"Resource.id",min:0,max:"1"},type:[{extension:[{url:"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",valueUrl:"string"}],code:"http://hl7.org/fhirpath/System.String"}],isModifier:!1,isSummary:!0},{id:"Patient.meta",path:"Patient.meta",short:"Metadata about the resource",definition:"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.",min:0,max:"1",base:{path:"Resource.meta",min:0,max:"1"},type:[{code:"Meta"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!0},{id:"Patient.implicitRules",path:"Patient.implicitRules",short:"A set of rules under which this content was created",definition:"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.",comment:"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.",min:0,max:"1",base:{path:"Resource.implicitRules",min:0,max:"1"},type:[{code:"uri"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!0,isModifierReason:"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation",isSummary:!0},{id:"Patient.language",path:"Patient.language",short:"Language of the resource content",definition:"The base language in which the resource is written.",comment:"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).",min:0,max:"1",base:{path:"Resource.language",min:0,max:"1"},type:[{code:"code"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!1,binding:{extension:[{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",valueCanonical:"http://hl7.org/fhir/ValueSet/all-languages"},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",valueString:"Language"},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",valueBoolean:!0}],strength:"preferred",description:"A human language.",valueSet:"http://hl7.org/fhir/ValueSet/languages"}},{id:"Patient.text",path:"Patient.text",short:"Text summary of the resource, for human interpretation",definition:'A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.',comment:'Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded information is added later.',alias:["narrative","html","xhtml","display"],min:0,max:"1",base:{path:"DomainResource.text",min:0,max:"1"},type:[{code:"Narrative"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!1},{id:"Patient.contained",path:"Patient.contained",short:"Contained, inline Resources",definition:"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.",comment:"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.",alias:["inline resources","anonymous resources","contained resources"],min:0,max:"*",base:{path:"DomainResource.contained",min:0,max:"*"},type:[{code:"Resource"}],isModifier:!1,isSummary:!1},{id:"Patient.extension",path:"Patient.extension",slicing:{discriminator:[{type:"value",path:"url"}],ordered:!1,rules:"open"},short:"Extension",definition:"An Extension",min:0,max:"*",base:{path:"DomainResource.extension",min:0,max:"*"},type:[{code:"Extension"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"},{key:"ext-1",severity:"error",human:"Must have either extensions or value[x], not both",expression:"extension.exists() != value.exists()",xpath:'exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])',source:"http://hl7.org/fhir/StructureDefinition/Extension"}],isModifier:!1,isSummary:!1},{id:"Patient.extension:race",path:"Patient.extension",sliceName:"race",short:"US Core Race Extension",definition:`Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:
|
|
1
|
+
"use strict";var A=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var je=(c,n,e)=>n in c?A(c,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[n]=e;var Be=(c,n)=>{for(var e in n)A(c,e,{get:n[e],enumerable:!0})},Qe=(c,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ne(n))!Ue.call(c,i)&&i!==e&&A(c,i,{get:()=>n[i],enumerable:!(t=Le(n,i))||t.enumerable});return c};var ze=c=>Qe(A({},"__esModule",{value:!0}),c);var d=(c,n,e)=>je(c,typeof n!="symbol"?n+"":n,e);var st={};Be(st,{BartSimpson:()=>w,BlinkyTheFish:()=>Ve,DifferentOrganization:()=>ee,DrAliceSmith:()=>s,DrAliceSmithPreviousVersion:()=>te,DrAliceSmithSchedule:()=>k,ExampleAccessPolicy:()=>Z,ExampleAuditEvent:()=>Ke,ExampleBot:()=>ne,ExampleBotSourceCode:()=>_e,ExampleClient:()=>oe,ExampleQuestionnaire:()=>ae,ExampleQuestionnaireResponse:()=>re,ExampleStatusValueSet:()=>J,ExampleSubscription:()=>pe,ExampleThreadHeader:()=>U,ExampleThreadMessages:()=>ye,ExampleUserConfiguration:()=>Y,ExampleWorkflowPlanDefinition:()=>j,ExampleWorkflowQuestionnaire1:()=>v,ExampleWorkflowQuestionnaire2:()=>b,ExampleWorkflowQuestionnaire3:()=>S,ExampleWorkflowQuestionnaireResponse1:()=>B,ExampleWorkflowRequestGroup:()=>ve,ExampleWorkflowTask1:()=>Q,ExampleWorkflowTask2:()=>z,ExampleWorkflowTask3:()=>W,FishPatientResources:()=>rt,HomerBartRelatedPerson:()=>Me,HomerCommunication:()=>de,HomerDiagnosticReport:()=>me,HomerEncounter:()=>P,HomerLisaRelatedPerson:()=>Te,HomerMedia:()=>le,HomerObservation1:()=>C,HomerObservation2:()=>I,HomerObservation3:()=>q,HomerObservation4:()=>O,HomerObservation5:()=>H,HomerObservation6:()=>F,HomerObservation7:()=>V,HomerObservation8:()=>L,HomerServiceRequest:()=>N,HomerSimpson:()=>m,HomerSimpsonPreviousVersion:()=>he,HomerSimpsonSpecimen:()=>T,HomerSimpsonUSCorePatient:()=>Ye,ImplantableDeviceKnee:()=>Xe,LisaSimpson:()=>ce,MOCK_ALICE_PRACTITIONER_ID:()=>R,MOCK_HOMER_PATIENT_ID:()=>We,MOCK_TEST_ORGANIZATION_ID:()=>Ge,MargeSimpson:()=>Ae,MockClient:()=>De,MockFetchClient:()=>_,MockReconnectingWebSocket:()=>G,MockSubscriptionManager:()=>M,SimpsonsFamily:()=>$e,TestOrganization:()=>X,USCoreStructureDefinitionList:()=>Je,createFakeJwt:()=>Re,exampleValueSet:()=>ge,makeDrAliceSmithSlots:()=>ie});module.exports=ze(st);var r=require("@medplum/core"),$=require("@medplum/fhir-router");var We="123",R="124",Ge="125";var Z={resourceType:"AccessPolicy",id:"123",name:"Example Access Policy"},J={resourceType:"ValueSet",id:"example-statuses",status:"active",compose:{include:[{concept:[{code:"ORDERED"},{code:"SENT_TO_CUSTOMER"},{code:"SENT_BACK_TO_LAB"},{code:"LAB_PROCESSED"},{code:"LAB_COMPLETE"}]}]}},Y={resourceType:"UserConfiguration",id:"123",name:"Example User Configuration",option:[{id:"statusValueSet",valueString:"ValueSet/example-statuses"}]};var E=require("@medplum/core");var X={resourceType:"Organization",id:"125",meta:{versionId:"1"},name:"Test Organization",address:[{use:"work",line:["123 Test Street"],city:"Springfield",state:"CA",postalCode:"90210",country:"US"}]},ee={resourceType:"Organization",id:"456",meta:{versionId:"1"},name:"Different"},s={resourceType:"Practitioner",id:"124",meta:{versionId:"2",lastUpdated:"2021-01-02T12:00:00Z",author:{reference:`Practitioner/${"124"}`}},name:[{given:["Alice"],family:"Smith"}],photo:[{contentType:E.ContentType.PNG,url:"https://www.medplum.com/img/cdc-femaledoc.png"}]},te={resourceType:"Practitioner",id:"124",meta:{versionId:"1",lastUpdated:"2021-01-01T12:00:00Z",author:{reference:`Practitioner/${"124"}`}},name:[{given:["Medplum"],family:"Admin"}]},k={resourceType:"Schedule",id:"alice-smith-schedule",actor:[{reference:`Practitioner/${"124"}`,display:"Dr. Alice Smith"}]},ie=(0,E.lazy)(()=>{let c=(0,E.createReference)(k),n=[],e=new Date;for(let t=0;t<60;t++){for(let i of[9,10,11,13,14,15])e.setHours(i,0,0,0),n.push({resourceType:"Slot",id:`slot-${t}-${i}`,status:"free",start:e.toISOString(),end:new Date(e.getTime()+3600*1e3).toISOString(),schedule:c});e.setDate(e.getDate()+1)}return n});var _e={resourceType:"Binary",id:"bot-source-code",contentType:"application/javascript"},ne={resourceType:"Bot",id:"123",name:"Test Bot",sourceCode:{contentType:"application/javascript",title:"index.js",url:"Binary/bot-source-code"}},oe={resourceType:"ClientApplication",id:"123",name:"Test Client"};var Pe=require("@medplum/core");var ae={resourceType:"Questionnaire",id:"123",url:"https://example.com/example-questionnaire",status:"active",name:"Vitals",title:"Vitals",subjectType:["Patient"],item:[{linkId:"1",text:"First question",type:"string"}]},re={resourceType:"QuestionnaireResponse",id:"123",status:"completed",questionnaire:"https://example.com/example-questionnaire",subject:{reference:`Patient/${"123"}`},source:(0,Pe.createReference)(s)};var o=require("@medplum/core");var se={use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},ce={resourceType:"Patient",id:"lisa-simpson",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},birthDate:"1981-05-09",name:[{given:["Lisa"],family:"Simpson"}],photo:[{contentType:"image/jpeg",url:"https://example.com/picture.jpg"}],contact:[{name:{given:["Homer"],family:"Simpson"},address:{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"homer@thesimpsons.com"}]},{name:{given:["Marge"],family:"Simpson"},address:{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"},telecom:[{system:"phone",use:"mobile",value:"139-1928"},{system:"email",use:"home",value:"marge@thesimpsons.com"}]}],telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"lisa@thesimpsons.com"}]},w={resourceType:"Patient",id:"555",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},birthDate:"1979-12-17",name:[{given:["Bart"],family:"Simpson"}],photo:[{contentType:"image/jpeg",url:"https://example.com/picture.jpg"}],telecom:[{system:"phone",use:"home",value:"555-1239"},{system:"email",use:"home",value:"bart@thesimpsons.com"}]},Te={resourceType:"RelatedPerson",id:"homer-lisa-related-person",patient:(0,o.createReference)(ce),address:[se],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],relationship:[{text:"father",coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-RoleCode",code:"FTH",display:"father"}]}]},Me={resourceType:"RelatedPerson",id:"homer-bart-related-person",patient:(0,o.createReference)(w),address:[se],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],relationship:[{text:"father",coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-RoleCode",code:"FTH",display:"father"}]}]},m={resourceType:"Patient",id:"123",gender:"male",meta:{versionId:"2",lastUpdated:"2020-01-02T00:00:00.000Z",author:(0,o.createReference)(s)},identifier:[{system:"abc",value:"123"},{system:"def",value:"456"}],active:!0,birthDate:"1956-05-12",name:[{given:["Homer"],family:"Simpson"}],photo:[{contentType:o.ContentType.PNG,url:"https://www.medplum.com/img/homer-simpson.png"}],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"chunkylover53@aol.com"}],address:[{use:"home",line:["742 Evergreen Terrace"],city:"Springfield",state:"IL",postalCode:"12345"}],link:[{other:(0,o.createReference)(Te),type:"seealso"},{other:(0,o.createReference)(Me),type:"seealso"}]},Ae={resourceType:"Patient",id:"marge-simpson",gender:"female",active:!0,birthDate:"1961-08-23",name:[{given:["Marge"],family:"Simpson"}],telecom:[{system:"phone",use:"home",value:"555-7334"},{system:"email",use:"home",value:"margesimpson@aol.com"}],address:[se]},he={resourceType:"Patient",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-01T00:00:00.000Z",author:(0,o.createReference)(s)},name:[{given:["Homer"],family:"Simpson"}],photo:[{contentType:o.ContentType.PNG,url:"https://www.medplum.com/img/homer-simpson.png"}]},P={resourceType:"Encounter",id:"123",meta:{versionId:"456",lastUpdated:"2020-01-01T00:00:00.000Z",author:(0,o.createReference)(s)},status:"finished",class:{code:"AMB",display:"ambulatory"}},de={resourceType:"Communication",id:"123",meta:{lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},status:"completed",encounter:(0,o.createReference)(P),payload:[{contentString:"Hello world"}]},le={resourceType:"Media",id:"123",meta:{lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},status:"completed",encounter:(0,o.createReference)(P),content:{contentType:o.ContentType.TEXT,url:"data:text/plain,This%20is%20a%20text/plain%20data%20URL"}},C={resourceType:"Observation",id:"1",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{coding:[{code:"test",system:"http://example.com"}],text:"Test 1"},valueString:"test"},I={resourceType:"Observation",id:"2",status:"corrected",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 2"},valueQuantity:{value:20,unit:"x"},referenceRange:[{low:{value:10}}]},q={resourceType:"Observation",id:"3",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 3"},valueQuantity:{value:30,unit:"x"},referenceRange:[{high:{value:50}}]},O={resourceType:"Observation",id:"4",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 4"},valueQuantity:{value:50,unit:"x",comparator:">"},referenceRange:[{low:{value:10,unit:"x"},high:{value:50,unit:"x"}}],interpretation:[{text:"HIGH"}]},H={resourceType:"Observation",id:"5",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 5"},valueQuantity:{value:100,unit:"x"},referenceRange:[{}],interpretation:[{}]},F={resourceType:"Observation",id:"6",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 6"},component:[{code:{text:"Systolic"},valueQuantity:{value:110,unit:"mmHg",system:o.UCUM}},{code:{text:"Diastolic"},valueQuantity:{value:75,unit:"mmHg",system:o.UCUM}}]},V={resourceType:"Observation",id:"7",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 7"},component:[{code:{text:"Glucose"},valueQuantity:{value:1e3,unit:"mg/dL",system:o.UCUM}}],interpretation:[{coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",code:"HH",display:"Critical high"}]}]},L={resourceType:"Observation",id:"8",status:"final",subject:{reference:"Patient/123",display:"Homer Simpson"},code:{text:"Test 8"},component:[{code:{text:"HIV"},valueString:"REACTIVE"}],referenceRange:[{text:"NEGATIVE"}],interpretation:[{coding:[{system:"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",code:"RR",display:"Reactive"}]}]},T={id:"123",resourceType:"Specimen",subject:(0,o.createReference)(m),collection:{collectedDateTime:"2020-01-01T12:00:00Z"},note:[{text:"Specimen hemolyzed. Results may be affected."},{text:"Specimen lipemic. Results may be affected."}]},N={resourceType:"ServiceRequest",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-01T12:00:00Z",author:(0,o.createReference)(s)},identifier:[{system:"https://example.com",value:"9001"}],code:{coding:[{system:o.SNOMED,code:"SERVICE_REQUEST_CODE"}]},subject:{reference:"Patient/123",display:"Homer Simpson"},status:"active",intent:"order",orderDetail:[{text:"ORDERED"}],specimen:[(0,o.createReference)(T)],authoredOn:"2020-01-01T12:00:00Z"},me={resourceType:"DiagnosticReport",id:"123",meta:{versionId:"1",lastUpdated:"2020-01-02T12:00:00Z",author:(0,o.createReference)(s)},status:"final",code:{text:"Test Report"},subject:(0,o.createReference)(m),basedOn:[(0,o.createReference)(N)],specimen:[(0,o.createReference)(T)],resultsInterpreter:[(0,o.createReference)(s)],result:[(0,o.createReference)(C),(0,o.createReference)(I),(0,o.createReference)(q),(0,o.createReference)(O),(0,o.createReference)(H),(0,o.createReference)(F),(0,o.createReference)(V),(0,o.createReference)(L)]},$e={resourceType:"Group",id:"simpsons-family",type:"person",actual:!0,member:[{entity:(0,o.createReference)(m)},{entity:(0,o.createReference)(Ae)},{entity:(0,o.createReference)(w)},{entity:(0,o.createReference)(ce)}]};var ue=require("@medplum/core");var pe={resourceType:"Subscription",id:"123",meta:{versionId:"456"},status:"active",reason:"Reason",criteria:"Criteria",channel:{type:"rest-hook",endpoint:"https://example.com"}},Ke={resourceType:"AuditEvent",id:"123",meta:{lastUpdated:new Date().toISOString(),versionId:"456",author:(0,ue.createReference)(s)},type:{system:"http://terminology.hl7.org/CodeSystem/audit-event-type",code:"rest-hook"},recorded:new Date().toISOString(),agent:[{requestor:!0,who:(0,ue.createReference)(s)}],source:{observer:{reference:"Device/123"}}};var y=require("@medplum/core");var U={id:"message-header-123",resourceType:"Communication",topic:{text:"Example Thread"},sender:(0,y.createReference)(s),recipient:[(0,y.createReference)(s),(0,y.createReference)(m)],sent:"2024-03-27T06:31:35Z",status:"in-progress"},ke={resourceType:"Communication",status:"completed",partOf:[(0,y.createReference)(U)]},fe={...ke,sender:(0,y.createReference)(s),recipient:[(0,y.createReference)(m)]},xe={...ke,sender:(0,y.createReference)(m),recipient:[(0,y.createReference)(s)]},ye=[{...fe,id:"message-1",payload:[{contentString:"Hi, Homer. Can you come in to discuss treatment for your radiation poisoning?"}],sent:"2024-03-27T06:31:35Z",received:"2024-03-27T06:31:39Z"},{...xe,id:"message-2",payload:[{contentString:"Aww, not again... Doh!"}],sent:"2024-03-27T06:32:35Z",received:"2024-03-27T06:32:39Z"},{...fe,id:"message-3",payload:[{contentString:"Homer, I haven't received your labs yet. Did you go for your lab work?"}],sent:"2024-03-27T06:35:35Z",received:"2024-03-27T06:36:35Z"},{...xe,payload:[{contentString:"Of course I did! Must be in the mail"}],sent:"2024-03-27T06:36:39Z",received:"2024-03-27T06:37:39Z"},{...fe,id:"message-5",payload:[{contentString:"Homer, this is for your own wellbeing. You need to take this seriously."}],sent:"2024-03-27T06:37:39Z",received:"2024-03-27T06:38:39Z"},{...xe,id:"message-6",status:"in-progress",payload:[{contentString:"Well I stopped eating donuts didn't I? Sometimes..."}],sent:"2024-03-27T06:38:42Z"}];var p=require("@medplum/core");var Ce=[{resourceType:"StructureDefinition",id:"us-core-patient",url:"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",version:"5.0.1",name:"USCorePatientProfile",title:"US Core Patient Profile",status:"active",experimental:!1,date:"2022-04-20T15:02:49-07:00",publisher:"HL7 International - Cross-Group Projects",contact:[{name:"HL7 International - Cross-Group Projects",telecom:[{system:"url",value:"http://www.hl7.org/Special/committees/cgp"},{system:"email",value:"cgp@lists.HL7.org"}]}],description:"The US Core Patient Profile meets the U.S. Core Data for Interoperability (USCDI) v2 'Patient Demographics' requirements. This profile sets minimum expectations for the Patient resource to record, search, and fetch basic demographics and other administrative information about an individual patient. It identifies which core elements, extensions, vocabularies and value sets **SHALL** be present in the resource when using this profile to promote interoperability and adoption through common implementation. It identifies which core elements, extensions, vocabularies and value sets **SHALL** be present in the resource when using this profile. It provides the floor for standards development for specific uses cases.",jurisdiction:[{coding:[{system:"urn:iso:std:iso:3166",code:"US"}]}],copyright:"Used by permission of HL7 International, all rights reserved Creative Commons License",fhirVersion:"4.0.1",kind:"resource",abstract:!1,type:"Patient",baseDefinition:"http://hl7.org/fhir/StructureDefinition/Patient",derivation:"constraint",snapshot:{element:[{id:"Patient",path:"Patient",short:"Information about an individual or animal receiving health care services",definition:"\\-",comment:"\\-",alias:["SubjectOfCare Client Resident"],min:0,max:"*",base:{path:"Patient",min:0,max:"*"},constraint:[{key:"dom-2",severity:"error",human:"If the resource is contained in another resource, it SHALL NOT contain nested Resources",expression:"contained.contained.empty()",xpath:"not(parent::f:contained and f:contained)",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-3",severity:"error",human:"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource",expression:"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()",xpath:"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-4",severity:"error",human:"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",expression:"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",xpath:"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"dom-5",severity:"error",human:"If a resource is contained in another resource, it SHALL NOT have a security label",expression:"contained.meta.security.empty()",xpath:"not(exists(f:contained/*/f:meta/f:security))",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{extension:[{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice",valueBoolean:!0},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation",valueMarkdown:"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],key:"dom-6",severity:"warning",human:"A resource should have narrative for robust management",expression:"text.`div`.exists()",xpath:"exists(f:text/h:div)",source:"http://hl7.org/fhir/StructureDefinition/DomainResource"},{key:"us-core-6",severity:"error",human:"Either Patient.name.given and/or Patient.name.family SHALL be present or a Data Absent Reason Extension SHALL be present.",expression:"(name.family.exists() or name.given.exists()) xor extension.where(url='http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()",xpath:"(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason' and not(/f:name/f:family or /f:name/f:given)) or (not(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason') and (/f:name/f:family or /f:name/f:given))"}],mustSupport:!1,isModifier:!1,isSummary:!1},{id:"Patient.id",path:"Patient.id",short:"Logical id of this artifact",definition:"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",comment:"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.",min:0,max:"1",base:{path:"Resource.id",min:0,max:"1"},type:[{extension:[{url:"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",valueUrl:"string"}],code:"http://hl7.org/fhirpath/System.String"}],isModifier:!1,isSummary:!0},{id:"Patient.meta",path:"Patient.meta",short:"Metadata about the resource",definition:"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.",min:0,max:"1",base:{path:"Resource.meta",min:0,max:"1"},type:[{code:"Meta"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!0},{id:"Patient.implicitRules",path:"Patient.implicitRules",short:"A set of rules under which this content was created",definition:"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.",comment:"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.",min:0,max:"1",base:{path:"Resource.implicitRules",min:0,max:"1"},type:[{code:"uri"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!0,isModifierReason:"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation",isSummary:!0},{id:"Patient.language",path:"Patient.language",short:"Language of the resource content",definition:"The base language in which the resource is written.",comment:"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).",min:0,max:"1",base:{path:"Resource.language",min:0,max:"1"},type:[{code:"code"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!1,binding:{extension:[{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",valueCanonical:"http://hl7.org/fhir/ValueSet/all-languages"},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",valueString:"Language"},{url:"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",valueBoolean:!0}],strength:"preferred",description:"A human language.",valueSet:"http://hl7.org/fhir/ValueSet/languages"}},{id:"Patient.text",path:"Patient.text",short:"Text summary of the resource, for human interpretation",definition:'A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.',comment:'Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded information is added later.',alias:["narrative","html","xhtml","display"],min:0,max:"1",base:{path:"DomainResource.text",min:0,max:"1"},type:[{code:"Narrative"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"}],isModifier:!1,isSummary:!1},{id:"Patient.contained",path:"Patient.contained",short:"Contained, inline Resources",definition:"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.",comment:"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.",alias:["inline resources","anonymous resources","contained resources"],min:0,max:"*",base:{path:"DomainResource.contained",min:0,max:"*"},type:[{code:"Resource"}],isModifier:!1,isSummary:!1},{id:"Patient.extension",path:"Patient.extension",slicing:{discriminator:[{type:"value",path:"url"}],ordered:!1,rules:"open"},short:"Extension",definition:"An Extension",min:0,max:"*",base:{path:"DomainResource.extension",min:0,max:"*"},type:[{code:"Extension"}],constraint:[{key:"ele-1",severity:"error",human:"All FHIR elements must have a @value or children",expression:"hasValue() or (children().count() > id.count())",xpath:"@value|f:*|h:div",source:"http://hl7.org/fhir/StructureDefinition/Element"},{key:"ext-1",severity:"error",human:"Must have either extensions or value[x], not both",expression:"extension.exists() != value.exists()",xpath:'exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])',source:"http://hl7.org/fhir/StructureDefinition/Extension"}],isModifier:!1,isSummary:!1},{id:"Patient.extension:race",path:"Patient.extension",sliceName:"race",short:"US Core Race Extension",definition:`Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:
|
|
2
2
|
|
|
3
3
|
- American Indian or Alaska Native
|
|
4
4
|
- Asian
|