UNPKG

@medplum/core

Version:

Medplum TS/JS Library

1 lines 223 kB
"use strict";var Nr=Object.defineProperty;var ss=Object.getOwnPropertyDescriptor;var as=Object.getOwnPropertyNames;var cs=Object.prototype.hasOwnProperty;var us=(r,e)=>{for(var t in e)Nr(r,t,{get:e[t],enumerable:!0})},ls=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of as(e))!cs.call(r,i)&&i!==t&&Nr(r,i,{get:()=>e[i],enumerable:!(n=ss(e,i))||n.enumerable});return r};var ds=r=>ls(Nr({},"__esModule",{value:!0}),r);var jl={};us(jl,{AccessPolicyInteraction:()=>xe,AckCode:()=>xl,AndAtom:()=>bt,ArithemticOperatorAtom:()=>V,AsAtom:()=>ce,BooleanInfixOperatorAtom:()=>C,CPT:()=>ms,ClientStorage:()=>Ke,ConcatAtom:()=>mt,ContainsAtom:()=>yt,ContentType:()=>A,DEFAULT_ACCEPT:()=>Mo,DEFAULT_MAX_SEARCH_COUNT:()=>wc,DEFAULT_SEARCH_COUNT:()=>Pc,DataSampler:()=>Pr,DotAtom:()=>ae,EmptySetAtom:()=>ft,EqualsAtom:()=>xt,EquivalentAtom:()=>Tt,EventTarget:()=>xr,ExternalSecretSystems:()=>Cu,FHIRCAST_EVENT_NAMES:()=>vr,FHIRCAST_EVENT_RESOURCES:()=>Eo,FHIRCAST_EVENT_VERSION_REQUIRED:()=>Tr,FHIRCAST_RESOURCE_TYPES:()=>bo,FhirFilterComparison:()=>Wt,FhirFilterConnective:()=>jt,FhirFilterNegation:()=>qt,FhirPathAtom:()=>ke,FhircastConnection:()=>kt,FileBuilder:()=>oi,FunctionAtom:()=>X,HTTP_HL7_ORG:()=>Br,HTTP_TERMINOLOGY_HL7_ORG:()=>xs,Hl7Context:()=>le,Hl7Field:()=>H,Hl7Message:()=>ai,Hl7Segment:()=>Ye,ICD10:()=>ys,ImpliesAtom:()=>Ct,InAtom:()=>gt,IndexerAtom:()=>ge,InfixOperatorAtom:()=>ee,IsAtom:()=>ye,LOINC:()=>ps,LRUCache:()=>Se,LiteralAtom:()=>F,LogLevel:()=>Le,LogLevelNames:()=>es,Logger:()=>ci,MEDPLUM_CLI_CLIENT_ID:()=>fu,MEDPLUM_RELEASES_URL:()=>ns,MEDPLUM_VERSION:()=>Cr,MedplumClient:()=>Ft,MedplumKeyValueClient:()=>Mt,MemoryStorage:()=>Er,MockAsyncClientStorage:()=>Qn,NDC:()=>gs,NotEqualsAtom:()=>vt,NotEquivalentAtom:()=>St,OAuthClientAssertionType:()=>Lo,OAuthGrantType:()=>Me,OAuthTokenAuthMethod:()=>Tu,OAuthTokenType:()=>_o,OperationOutcomeError:()=>p,Operator:()=>f,OperatorPrecedence:()=>g,OrAtom:()=>Et,Parser:()=>$t,ParserBuilder:()=>tt,PrefixOperatorAtom:()=>et,PropertyType:()=>l,RXNORM:()=>hs,ReadablePromise:()=>M,ReconnectingWebSocket:()=>_t,SNOMED:()=>fs,SearchParameterType:()=>Y,SubscriptionEmitter:()=>Xe,SubscriptionManager:()=>Lt,SymbolAtom:()=>q,Tokenizer:()=>ue,TransformMapCollection:()=>kr,TypedEventTarget:()=>G,UCUM:()=>Ur,UnaryOperatorAtom:()=>ht,UnionAtom:()=>me,VALID_HOSTNAME_REGEX:()=>zi,XorAtom:()=>Rt,accepted:()=>ws,accessPolicySupportsInteraction:()=>Nn,addProfileToResource:()=>Ua,allOk:()=>vs,append:()=>Ae,applyDefaultValuesToElement:()=>Lu,applyDefaultValuesToResource:()=>_u,applyFixedOrPatternValue:()=>Ut,arrayBufferToBase64:()=>Rn,arrayBufferToHex:()=>En,arrayify:()=>Ue,assert:()=>Ao,assertContextVersionOptional:()=>qn,assertOk:()=>Bs,assertReleaseManifest:()=>is,badRequest:()=>b,booleanToTypedValue:()=>h,buildElementsContext:()=>Ar,buildTypeName:()=>ro,businessRule:()=>ks,calculateAge:()=>ut,calculateAgeString:()=>fa,canReadResourceType:()=>Kc,canWriteResource:()=>Xc,canWriteResourceType:()=>Zc,capitalize:()=>I,checkForNull:()=>ui,checkIfValidMedplumVersion:()=>Bl,clearReleaseCache:()=>Ul,compressElement:()=>qs,concatUrls:()=>B,conceptMapTranslate:()=>ti,conflict:()=>As,convertContainedResourcesToBundle:()=>iu,convertToSearchableDates:()=>Dn,convertToSearchableNumbers:()=>vc,convertToSearchableQuantities:()=>Tc,convertToSearchableReferences:()=>_n,convertToSearchableStrings:()=>Mn,convertToSearchableTokens:()=>Ln,convertToSearchableUris:()=>Sc,convertToTransactionBundle:()=>vo,crawlTypedValue:()=>er,crawlTypedValueAsync:()=>Ks,createConstraintIssue:()=>Xr,createFhircastMessagePayload:()=>br,createOperationOutcomeIssue:()=>de,createProcessingIssue:()=>Yr,createReference:()=>pe,createStructureIssue:()=>T,created:()=>Ts,decodeBase64:()=>xo,decodeBase64Url:()=>Un,deepClone:()=>he,deepEquals:()=>ne,deepIncludes:()=>Be,encodeBase64:()=>It,encodeBase64Url:()=>eu,encryptSHA256:()=>Bn,ensureNoLeadingSlash:()=>Qi,ensureTrailingSlash:()=>pr,escapeHtml:()=>ja,evalFhirPath:()=>xc,evalFhirPathTyped:()=>E,evalSqlOnFhir:()=>Ml,expandSampledData:()=>Kn,expandSampledObservation:()=>Ou,fetchLatestVersionString:()=>Wl,fetchVersionManifest:()=>Fr,fhirPathArrayEquals:()=>mn,fhirPathArrayEquivalent:()=>or,fhirPathArrayNotEquals:()=>yn,fhirPathEquals:()=>We,fhirPathEquivalent:()=>Mi,fhirPathIs:()=>st,fhirPathNot:()=>hn,fhirTypeToJsType:()=>tr,findObservationInterval:()=>wa,findObservationReferenceRange:()=>Aa,findObservationReferenceRanges:()=>ji,findResourceByCode:()=>La,flatMapFilter:()=>qa,forbidden:()=>bs,formatAddress:()=>Ki,formatCodeableConcept:()=>qe,formatCoding:()=>kn,formatDate:()=>Ha,formatDateTime:()=>fr,formatFamilyName:()=>Ga,formatGivenName:()=>$a,formatHl7DateTime:()=>Yo,formatHumanName:()=>$e,formatMoney:()=>ec,formatObservationValue:()=>Xi,formatPeriod:()=>Qa,formatQuantity:()=>oe,formatRange:()=>Ya,formatReferenceString:()=>Ji,formatSearchQuery:()=>Fc,formatTime:()=>Zi,formatTiming:()=>Za,generateId:()=>ve,getAllDataTypes:()=>on,getAllQuestionnaireAnswers:()=>ma,getCodeBySystem:()=>cr,getDataType:()=>te,getDateProperty:()=>pa,getDefaultValuesForNewSliceEntry:()=>Fu,getDisplayString:()=>Fi,getElementDefinition:()=>ct,getElementDefinitionFromElements:()=>io,getElementDefinitionTypeName:()=>Jt,getExpressionForResourceType:()=>Vl,getExpressionsForResourceType:()=>li,getExtension:()=>re,getExtensionValue:()=>ga,getIdentifier:()=>Bi,getImageSrc:()=>da,getNestedProperty:()=>Pe,getParsedExpressionForResourceType:()=>rs,getPathDifference:()=>ie,getPathDisplayName:()=>ac,getPropertyDisplayName:()=>no,getQueryString:()=>On,getQuestionnaireAnswers:()=>ha,getRandomString:()=>gr,getReferenceString:()=>D,getResourceTypes:()=>ic,getSearchParameter:()=>sc,getSearchParameterDetails:()=>Pl,getSearchParameters:()=>oc,getStatus:()=>Us,getTypedPropertyValue:()=>P,getTypedPropertyValueWithPath:()=>wi,getTypedPropertyValueWithSchema:()=>Vi,getTypedPropertyValueWithoutSchema:()=>Di,getValueSliceName:()=>Xn,getWebSocketUrl:()=>An,globalSchema:()=>L,gone:()=>Es,indexDefaultSearchParameters:()=>ln,indexSearchParameter:()=>mr,indexSearchParameterBundle:()=>nc,indexStructureDefinitionBundle:()=>Zt,inflateBaseSchema:()=>en,inflateElement:()=>Ti,initFhirPathParserBuilder:()=>He,isAccepted:()=>Ds,isCodeableConcept:()=>ar,isCoding:()=>sr,isCompletedSubscriptionRequest:()=>jn,isComplexTypeCode:()=>ur,isConflict:()=>Ls,isContextVersionRequired:()=>Wn,isCreated:()=>Vs,isDataTypeLoaded:()=>sn,isDateString:()=>gn,isDateTimeString:()=>we,isEmpty:()=>S,isError:()=>xi,isFhirCriteriaMet:()=>Oo,isFhircastResourceType:()=>Ro,isGone:()=>Fs,isJwt:()=>$n,isLowerCase:()=>Ca,isMedplumAccessToken:()=>Gn,isNotFound:()=>_s,isObject:()=>R,isOk:()=>zt,isOperationOutcome:()=>Ee,isPeriod:()=>xn,isPopulated:()=>J,isPrimitiveType:()=>nt,isProfileLoaded:()=>cn,isProfileResource:()=>Li,isQuantity:()=>w,isQuantityEquivalent:()=>vn,isRedirect:()=>Ms,isReference:()=>U,isResource:()=>O,isResourceType:()=>an,isResourceTypeSchema:()=>Yt,isResourceWithId:()=>je,isSliceDefinitionWithTypes:()=>Zn,isString:()=>dt,isStringArray:()=>bn,isTextObject:()=>Wi,isTypedValue:()=>lc,isUUID:()=>Ra,isUnauthenticated:()=>Ns,isValidDate:()=>hr,isValidHostname:()=>Na,isValidMedplumSemver:()=>os,lazy:()=>wn,loadDataType:()=>Xt,mapByIdentifier:()=>Ba,matchDiscriminant:()=>nr,matchesRange:()=>Pn,matchesSearchRequest:()=>Ot,multipleMatches:()=>Cs,normalizeArrayBufferView:()=>Cn,normalizeCreateBinaryOptions:()=>Jn,normalizeCreatePdfOptions:()=>Fo,normalizeErrorString:()=>Re,normalizeOperationOutcome:()=>rt,notFound:()=>zr,notModified:()=>Ss,operationOutcomeIssueToString:()=>vi,operationOutcomeToString:()=>Zr,parseFhirPath:()=>At,parseFilterParameter:()=>gl,parseHl7DateTime:()=>Tl,parseJWTPayload:()=>Dt,parseLogLevel:()=>bl,parseMappingLanguage:()=>Qu,parseParameter:()=>po,parseReference:()=>ca,parseSearchRequest:()=>Qe,parseStructureDefinition:()=>Kt,parseXFhirQuery:()=>Lc,preciseEquals:()=>Da,preciseGreaterThan:()=>_a,preciseGreaterThanOrEquals:()=>Hi,preciseLessThan:()=>Ma,preciseLessThanOrEquals:()=>Gi,preciseRound:()=>Va,preconditionFailed:()=>Rs,projectAdminResourceTypes:()=>ho,protectedResourceTypes:()=>fo,readInteractions:()=>mo,redirect:()=>Is,removeDuplicates:()=>ot,removeProfileFromResource:()=>Wa,reorderBundle:()=>To,resolveId:()=>fe,resourceMatchesSubscriptionCriteria:()=>du,satisfiedAccessPolicy:()=>yo,serializeFhircastSubscriptionRequest:()=>Sr,serverError:()=>Kr,serverTimeout:()=>Os,setCodeBySystem:()=>Pa,setIdentifier:()=>ya,singleton:()=>$,singularize:()=>Fa,sleep:()=>lr,sortStringArray:()=>pt,splitN:()=>dr,splitSearchOnComma:()=>ze,streamToBuffer:()=>Dl,stringify:()=>lt,stringifyTypedValue:()=>Vn,structureMapTransform:()=>zu,subsetResource:()=>Gs,summarizeObservations:()=>Pu,toJsBoolean:()=>_,toPeriod:()=>at,toTypedValue:()=>x,tooManyRequests:()=>Ps,tryGetDataType:()=>Ne,tryGetJwtExpiration:()=>Hn,tryGetProfile:()=>un,typedValueToString:()=>In,unauthorized:()=>be,unauthorizedTokenAudience:()=>Qt,unauthorizedTokenExpired:()=>Jr,validateFhircastSubscriptionRequest:()=>Vt,validateResource:()=>ea,validateResourceType:()=>El,validateTypedValue:()=>ta,validationError:()=>y,validationRegexes:()=>it,warnIfNewerVersionAvailable:()=>ql,wordWrap:()=>Zo});module.exports=ds(jl);var et=class{constructor(e,t){this.operator=e,this.child=t}toString(){return`${this.operator}(${this.child.toString()})`}},ee=class{constructor(e,t,n){this.operator=e,this.left=t,this.right=n}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}},tt=class{constructor(){this.prefixParselets={};this.infixParselets={}}registerInfix(e,t){return this.infixParselets[e]=t,this}registerPrefix(e,t){return this.prefixParselets[e]=t,this}prefix(e,t,n){return this.registerPrefix(e,{parse(i,o){let s=i.consumeAndParse(t);return n(o,s)}})}infixLeft(e,t,n){return this.registerInfix(e,{parse(i,o,s){let a=i.consumeAndParse(t);return n(o,s,a)},precedence:t})}construct(e){return new $t(e,this.prefixParselets,this.infixParselets)}},$t=class{constructor(e,t,n){this.tokens=e,this.prefixParselets=t,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(e){return this.peek()?.id!==e?!1:(this.consume(),!0)}consumeAndParse(e=1/0){let t=this.consume(),n=this.prefixParselets[t.id];if(!n)throw Error(`Parse error at "${t.value}" (line ${t.line}, column ${t.column}). No matching prefix parselet.`);let i=n.parse(this,t);for(;e>this.getPrecedence();){let o=this.consume();i=this.getInfixParselet(o).parse(this,i,o)}return i}getPrecedence(){let e=this.peek();if(!e)return 1/0;let t=this.getInfixParselet(e);return t?t.precedence:1/0}consume(e,t){if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(e&&this.peek()?.id!==e){let n=this.peek();throw Error(`Expected ${e} but got "${n.id}" (${n.value}) at line ${n.line} column ${n.column}.`)}if(t&&this.peek()?.value!==t){let n=this.peek();throw Error(`Expected "${t}" but got "${n.value}" at line ${n.line} column ${n.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(e=>e.id!=="Comment")}getInfixParselet(e){return this.infixParselets[e.id==="Symbol"?e.value:e.id]}};var Se=class{constructor(e=10){this.max=e,this.cache=new Map}clear(){this.cache.clear()}get(e){let t=this.cache.get(e);return t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(e,t)}delete(e){this.cache.delete(e)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}};var Ur="http://unitsofmeasure.org",ps="http://loinc.org",fs="http://snomed.info/sct",hs="http://www.nlm.nih.gov/research/umls/rxnorm",ms="http://www.ama-assn.org/go/cpt",ys="http://hl7.org/fhir/sid/icd-10",gs="http://hl7.org/fhir/sid/ndc",Br="http://hl7.org",xs="http://terminology.hl7.org";var Wr="ok",Gt="created",qr="gone",jr="not-modified",$r="found",Gr="not-found",Hr="conflict",Qr="unauthorized",pi="forbidden",fi="precondition-failed",hi="multiple-matches",mi="too-many-requests",Ht="accepted",yi="server-timeout",gi="business-rule",vs={resourceType:"OperationOutcome",id:Wr,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Ts={resourceType:"OperationOutcome",id:Gt,issue:[{severity:"information",code:"informational",details:{text:"Created"}}]},Ss={resourceType:"OperationOutcome",id:jr,issue:[{severity:"information",code:"informational",details:{text:"Not Modified"}}]},zr={resourceType:"OperationOutcome",id:Gr,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},be={resourceType:"OperationOutcome",id:Qr,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Jr={...be,issue:[...be.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},Qt={...be,issue:[...be.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},bs={resourceType:"OperationOutcome",id:pi,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]},Es={resourceType:"OperationOutcome",id:qr,issue:[{severity:"error",code:"deleted",details:{text:"Gone"}}]},Rs={resourceType:"OperationOutcome",id:fi,issue:[{severity:"error",code:"processing",details:{text:"Precondition Failed"}}]},Cs={resourceType:"OperationOutcome",id:hi,issue:[{severity:"error",code:"multiple-matches",details:{text:"Multiple resources found matching condition"}}]},Ps={resourceType:"OperationOutcome",id:mi,issue:[{severity:"error",code:"throttled",details:{text:"Too Many Requests"}}]};function ws(r){return{resourceType:"OperationOutcome",id:Ht,issue:[{severity:"information",code:"informational",details:{text:"Accepted"},diagnostics:r}]}}function b(r,e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:r},...e?{expression:[e]}:void 0}]}}function As(r,e){return{resourceType:"OperationOutcome",id:Hr,issue:[{severity:"error",code:"conflict",details:{coding:e?[{code:e}]:void 0,text:r}}]}}function y(r){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:r}}]}}function Kr(r){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:r.toString()}]}}function Os(r){return{resourceType:"OperationOutcome",id:yi,issue:[{severity:"error",code:"timeout",details:{text:r??"Server timeout"}}]}}function Is(r){let e=r.toString();return{resourceType:"OperationOutcome",id:$r,issue:[{severity:"information",code:"informational",details:{coding:[{system:"urn:ietf:rfc:3986",code:e}],text:"Redirect to "+e}}]}}function ks(r,e){return{resourceType:"OperationOutcome",id:gi,issue:[{severity:"error",code:"business-rule",details:{id:r,text:e}}]}}function xi(r){return!r||typeof r!="object"?!1:r instanceof Error||typeof DOMException<"u"&&r instanceof DOMException?!0:Object.prototype.toString.call(r)==="[object Error]"}function Ee(r){return typeof r=="object"&&r!==null&&r.resourceType==="OperationOutcome"}function zt(r){return r.id===Wr||r.id===Gt||r.id===jr||r.id===Ht}function Vs(r){return r.id===Gt}function Ds(r){return r.id===Ht}function Ms(r){return r.id===$r}function _s(r){return r.id===Gr}function Ls(r){return r.id===Hr}function Fs(r){return r.id===qr}function Ns(r){return r.id===Qr}function Us(r){switch(r.id){case Wr:return 200;case Gt:return 201;case Ht:return 202;case $r:return 302;case jr:return 304;case Qr:return 401;case pi:return 403;case Gr:return 404;case Hr:return 409;case qr:return 410;case fi:case hi:return 412;case gi:return 422;case mi:return 429;case yi:return 504;default:return r.issue?.[0]?.code==="exception"?500:400}}function Bs(r,e){if(!zt(r)||e===void 0)throw new p(r)}var p=class extends Error{constructor(e,t){super(Zr(e)),this.outcome=e,this.cause=t}};function rt(r){return r instanceof p?r.outcome:Ee(r)?r:b(Re(r))}function Re(r){return r?typeof r=="string"?r:xi(r)?r.message:Ee(r)?Zr(r):typeof r=="object"&&"code"in r&&typeof r.code=="string"?r.code:JSON.stringify(r):"Unknown error"}function Zr(r){let e=r.issue?.map(vi)??[];return e.length>0?e.join("; "):"Unknown error"}function vi(r){let e;return r.details?.text?r.diagnostics?e=`${r.details.text} (${r.diagnostics})`:e=r.details.text:r.diagnostics?e=r.diagnostics:e="Unknown error",r.expression?.length&&(e+=` (${r.expression.join(", ")})`),e}function de(r,e,t,n,i){let o={severity:r,code:e,details:{text:t},expression:[n]};return i&&(o.diagnostics=JSON.stringify(i)),o}function T(r,e){return de("error","structure",e,r)}function Xr(r,e){return de("error","invariant",`Constraint ${e.key} not met: ${e.description}`,r,{fhirpath:e.expression})}function Yr(r,e,t,n){return de("error","processing",e,r,{...n,error:t})}var Ws={"http://hl7.org/fhirpath/System.String":"string"};function qs(r){let e={};return r.min!==0&&(e.min=r.min),r.max!==1&&Number.isFinite(r.max)?e.max=r.max:r.max===Number.POSITIVE_INFINITY&&(e.max=Number.MAX_SAFE_INTEGER),e.type=r.type?.map(t=>({...t,extension:void 0,code:Ws[t.code]??t.code})),e}function Ti(r,e){let t=e.max&&e.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:e.max;return{path:r,description:"",type:e.type??[],min:e.min??0,max:t??1,isArray:!!t&&t>1,constraints:[]}}function en(r){let e=Object.create(null);for(let[t,n]of Object.entries(r))e[t]={name:t,type:t,path:t,elements:Object.fromEntries(Object.entries(n.elements).map(([i,o])=>[i,Ti(i,o)])),constraints:[],innerTypes:[]};return e}var Si={Element:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},BackboneElement:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Address:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Age:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Annotation:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},Attachment:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},CodeableConcept:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Coding:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},ContactDetail:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},ContactPoint:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},Contributor:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},Count:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},DataRequirement:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},DataRequirementCodeFilter:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},DataRequirementDateFilter:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},DataRequirementSort:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Distance:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Dosage:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},DosageDoseAndRate:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Duration:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},ElementDefinition:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},ElementDefinitionSlicingDiscriminator:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},ElementDefinitionSlicing:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},ElementDefinitionBase:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},ElementDefinitionType:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},ElementDefinitionExample:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},ElementDefinitionConstraint:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},ElementDefinitionBinding:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},ElementDefinitionMapping:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},Expression:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},Extension:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},HumanName:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Identifier:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},MarketingStatus:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},Meta:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},Money:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Narrative:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},ParameterDefinition:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},Period:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},Population:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},ProdCharacteristic:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},ProductShelfLife:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},Quantity:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Range:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Ratio:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Reference:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},RelatedArtifact:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},SampledData:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},Signature:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},SubstanceAmount:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},SubstanceAmountReferenceRange:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},Timing:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},TimingRepeat:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},TriggerDefinition:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},UsageContext:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},MoneyQuantity:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},SimpleQuantity:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},IdentityProvider:{elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}}};function Kt(r){return new rn(r).parse()}var Ce=en(Si),nn=Object.create(null),bi=Object.create(null),$s={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function Pi(r){let e;return e=bi[r],e||(e=bi[r]=Object.create(null)),e}function Zt(r){let t=(Array.isArray(r)?r:r.entry?.map(n=>n.resource)??[]).filter(n=>n?.resourceType==="StructureDefinition");ln(t);for(let n of t)Xt(n)}function Xt(r){if(!r?.name)throw new Error("Failed loading StructureDefinition from bundle");if(r.resourceType!=="StructureDefinition")return;let e=Kt(r),t=$s[r.url],n,i;t?(n=Ce,i=t):r.url===`http://hl7.org/fhir/StructureDefinition/${r.type}`||r.url===`https://medplum.com/fhir/StructureDefinition/${r.type}`||r.type?.startsWith("http://")||r.type?.startsWith("https://")?(n=Ce,i=r.type):(n=Pi(r.url),i=r.type),n[i]=e;for(let o of e.innerTypes)o.parentType=e,n[o.name]=o;nn[r.url]=e}function on(){return Ce}function sn(r){return!!Ce[r]}function Ne(r,e){if(e){let t=Pi(e)[r];if(t)return t}return Ce[r]}function te(r,e){let t=Ne(r,e);if(!t)throw new p(b("Unknown data type: "+r));return t}function an(r){let e=Ce[r];return e&&Yt(e)}function cn(r){return!!nn[r]}function un(r){return nn[r]}var rn=class{constructor(e){if(!e.snapshot?.element||e.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);this.root=e.snapshot.element[0],this.elements=e.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:e.name,path:this.root.path,title:e.title,type:e.type,url:e.url,version:e.version,kind:e.kind,description:Js(e),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let e=this.next();for(;e;){if(e.sliceName)this.parseSliceStart(e);else if(e.id?.includes(":")){if(this.slicingContext?.current){let t=tn(e,this.slicingContext.path);this.slicingContext.current.elements[t]=this.parseElementDefinition(e)}}else{let t=this.parseElementDefinition(e);this.checkFieldEnter(e,t);let n=this.backboneContext;for(;n;){if(e.path?.startsWith(n.path+".")){n.type.elements[tn(e,n.path)]=t;break}n=n.parent}if(!n){let i=tn(e,this.root.path);e.isSummary&&this.resourceSchema.summaryProperties?.add(i.replace("[x]","")),t.min>0&&this.resourceSchema.mandatoryProperties?.add(i.replace("[x]","")),this.resourceSchema.elements[i]=t}this.checkFieldExit(e)}e=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(e,t){this.isInnerType(e)&&this.enterInnerType(e),this.slicingContext&&!Fe(this.slicingContext.path,e?.path)&&(this.slicingContext=void 0),e.slicing&&!this.slicingContext&&this.enterSlice(e,t)}enterInnerType(e){for(;this.backboneContext&&!Fe(this.backboneContext?.path,e.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;let t=Jt(e);this.backboneContext={type:{name:t,type:t,path:e.path,title:e.label,description:e.definition,elements:{},constraints:this.parseElementDefinition(e).constraints,innerTypes:[]},path:e.path,parent:Fe(this.backboneContext?.path,e.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(e,t){zs(e)&&!this.peek()?.sliceName||(t.slicing={discriminator:(e.slicing?.discriminator??[]).map(n=>{if(n.type!=="value"&&n.type!=="pattern"&&n.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${n.type}`);return{path:n.path,type:n.type}}),slices:[],ordered:e.slicing?.ordered??!1,rule:e.slicing?.rules},this.slicingContext={field:t.slicing,path:e.path??""})}checkFieldExit(e=void 0){if(this.backboneContext&&!Fe(this.backboneContext.path,e?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Fe(this.backboneContext.path,e?.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){let e=this.peek();if(e)return this.index++,e}peek(){let e=this.elements[this.index];if(e){if(this.elementIndex[e.path??""]=e,e.contentReference){let t=e.contentReference.slice(e.contentReference.indexOf("#")+1),n=this.elementIndex[t];return n?{...n,id:e.id,path:e.path,min:e.min??n.min,max:e.max??n.max,base:{path:n.base?.path??t,min:e.base?.min??n.base?.min??n.min,max:e.base?.max??n.base?.max??n.max},contentReference:e.contentReference,definition:e.definition}:void 0}return e}}isInnerType(e){let t=this.peek();return!!(Fe(e?.path,t?.path)&&e.type?.some(n=>["BackboneElement","Element"].includes(n.code)))}parseSliceStart(e){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);this.slicingContext.current={...this.parseElementDefinition(e),name:e.sliceName??"",definition:e.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(e){return(e.type??[]).map(t=>{let n;return(t.code==="BackboneElement"||t.code==="Element")&&(n=Jt(e)),n||(n=re(t,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),n||(n=t.code??""),{code:n,targetProfile:t.targetProfile,profile:t.profile}})}parseElementDefinition(e){let t=Ri(e.max),n=e.base?.max?Ri(e.base.max):t,i={type:"ElementDefinition",value:e};return{description:e.definition||"",path:e.path|