Showing posts with label V2toFHIR. Show all posts
Showing posts with label V2toFHIR. Show all posts

Wednesday, July 9, 2025

A syntax for validating V2toFHIR Conversions

I've been working on V2toFHIR since its inception.  A month ago, and back in January I participated in two Connectathons that are using that capability from this code.  In building that engine, I needed a way to test a conversion of an HL7 message in a way that would make it easier for me to write detailed tests.

The input to a test is an HL7 V2 message with segments.  A very long time ago, I resolved to use plain-text files containing messages and divide them with a blank line.  Here's an example below of a file with two messages I've previously used for other purposes at IHE Connectathons (I have several years of IHE Connectathon test data lying about):

# Outbound ack:

MSH|^~\&|PAT_IDENTITY_X_REF_MGR_MISYS_TLS|ALLSCRIPTS|OTHER_IBM_BRIDGE_TLS|IBM|20090224114149-0500||ACK^A04|OpenPIXPDQ10.243.0.65.19767899354465|P|2.3.1

MSA|AA|0851077658473390286


# PIX Feed (ADT^A01)

# Inbound feed:

MSH|^~\&|OTHER_IBM_BRIDGE_TLS|IBM|PAT_IDENTITY_X_REF_MGR_MISYS|ALLSCRIPTS|20090224104152-0600||ADT^A01^ADT_A01|8686183982575368499|P|2.3.1

EVN||20090224104152-0600

PID|||102^^^IBOT&1.3.6.1.4.1.21367.2009.1.2.370&ISO||SINGLETON^MARION||19661109|F

PV1||I


You might also note that I allow for comment characters at the start of the line. My test framework simply ignores those lines while reading the test data, and if gives me a way to identify the test case. For testing V2 to FHIR Conversions, I needed a way to create assertions that would be used to verify the assertion.  Of course, FHIRPath comes to mind because it's already an expression language widely used in FHIR itself for assertions and other manipulations of FHIR Resources.  That's ideal language for my use case.


So, I added a capability in my test case reader to add assertions to the test case. Here's an example for the first test case above.  The @ sign introduces an assertion.


@MessageHeader.source.name = "PAT_IDENTIFY_X_REF_MGR_MISYS_TLS"

@MessageHeader.source.endpoint = "ALLSCRIPTS"

@MessageHeader.destination.name = "OTHER_IBM_BRIDGE_TLS"

@MessageHeader.destination.endpoint = "IBM"


I'm actually checking a bundle but use a little string substitution hackery to replace MessageHeader with %context.entry.resource.ofType(MessageHeader) at the head of the expression to save me about 31 characters of typing each time.


The next bit of fun is enabling the assertions to come close to where they are useful in the message.  It should be obvious that each test case has two streams of data, the message, and the assertions.  They can easily be interwoven.  So, assertions can easily follow the segment, but I also wanted more, because some segments can be very long.  Borrowing from other scripting languages (e.g., bash), I allow the introduction of the \ character at the end of the line to allow lines to be continued.  I realized that it would be important to visually see the start an end of a segment in the file, so I ignore leading whitespace at the beginning of continuation lines.  So now I can write:


# Outbound ack:

MSH|^~\&|\

PAT_IDENTITY_X_REF_MGR_MISYS_TLS|\

@MessageHeader.source.name = "PAT_IDENTIFY_X_REF_MGR_MISYS_TLS"

ALLSCRIPTS|\

@MessageHeader.source.endpoint = "ALLSCRIPTS"

OTHER_IBM_BRIDGE_TLS|\

@MessageHeader.destination.name = "OTHER_IBM_BRIDGE_TLS"

IBM|20090224114149-0500|\

@MessageHeader.destination.endpoint = "IBM"

|ACK^A04|OpenPIXPDQ10.243.0.65.19767899354465|P|2.3.1

MSA|AA|0851077658473390286


And so forth.  In this way, I now have a test case where I can start with the message in my usual form (simple text with a blank line between cases).  From there I can augment the test case with assertions that I feel are important.  Following that, I can also break things up, even just long lines of V2 messages to make the test files more readable.


The final piece of this was to allow long assertions to be broken up the same way messages are, and to steal the final comment in the assertion expression (comments are part of FHIRPath syntax) to use for my assertion message in my testing framework.  That's also just simple string substitution as well.


You can find all of the code for this in V2toFHIR, the open-source converter my team and I created for some of our ongoing work.  The two key files of interest are MessageParserTests.java and TestData.java.  The method TestData.load() is where all the test input parsing magic happens.  It's not really that complicated.




Monday, June 2, 2025

Code generators need not be perfect

Le mieux est le mortel
ennemi du bien. -- Voltaire

I've been working on expanding the v2tofhir code that Audacious Inquiry developed for one of our projects into a broader offering for public health that handles more than just Immunization messages.  That's not going back into the original open-source work, as it is not within the scope of that program. But it is going to become an application available to our customers. Contact me if you want to learn more.

One thing I relearned from my vibe coding session with Copilot is that code generators don't have to be perfect -- although it certainly helps if they are.  I already know from years of experience working with natural language processing is that heuristics can often get you most of the way there, and specialized exception handling can handle what the heuristic doesn't.

By putting these two ideas together I can successfully generate code for the 2700+ mapping rules in the current HL7 V2 to FHIR specification in just minutes.   This makes my code generator immediately effective to support the 75 or so segment mapping tables supported by that specification. With a few minutes, I can generate code to support every segment, and within a few hours more, can correct all of the missing bits.  

The compiler is a perfect tool for detecting the exception cases. Like a canary in a coal mine, it is especially sensitive to danger. The code generator I'm still developing has been an excellent QA resource for the HL7 V2 to FHIR spec, as it enables me to verify content in the spec.  Some errors in the generated output are actually caused by typos in the over 10000 lines of CSV data that is used to generate the HL7 standard.

This is a tremendous lift for development, and as we figure out the patterns of errors, we can easily augment the code generator to fix them.  While that's being done, we still have code that we can tweak to perfection in much less time than it takes to generate it manually.  It also reduces the amount of SME expertise needed to create the application.  

The original open-source code took a more manual approach to automation (I was actually trying to figure out the process in using spreadsheets).  It took about 3 months of work to handle about 20 segments.  Easily half of that was putting together the surrounding infrastructure rather than parsing individual segments.  The code generator took about a week to build.  It gets very close to final code for 75 segments.  These leave me about 40-50 errors to resolve, most of which are simple.  I'm expecting another week or two will be needed to handle those issues in the generated code.  This is easily an order of magnitude improvement. It can be repeated on new editions of the V2 to FHIR outputs much faster than fixing the code by hand, which also speeds up maintenance.



Monday, July 8, 2024

Automating V2toFHIR conversion and Testing

Yesterday morning morning I talked about automating my V2 to FHIR testing.  Now I'm going to talk about automating conversions.  I had to write a segment converter (more like four) before I finally found the right conversion pattern to base the automation on.

It sort of looks like this:

public class PIDParser extends AbstractSegmentParser {
    @Override
    public void parse(Segment pid) throws HL7Exception {
        if (isEmpty(pid)) {
            return;
        }

        Patient patient = this.createResource(Patient.class);
        // Patient identifier
        addField(pid, 2, Identifier.class, patient::addIdentifier);
        // Patient identifier list
        addFields(pid, 3, Identifier.class, patient::addIdentifier);
        // Patient alternate identifier
        addField(pid, 4, Identifier.class, patient::addIdentifier);
        // Patient name
        addFields(pid, 5, HumanName.class, patient::addName);
        // Mother's maiden name
        addFields(pid, 6, patient, HumanName.class, this::addMothersMaidenName);
        // Patient Birth Time
        addField(pid, 7, patient, DateTimeType.class, this::addBirthDateTime);
    
        /* ... and so on for another 30 fields */
    }

Let met help you interpret that.  The addField() method takes a segment and field number, gets the first occurrence of the field.  If it exists, it converts it to the type specified in the third argument (e.g., Identifier.class, HumanName.class, DateTimeType.class).  If the conversion is successful, it then sends the result to the Consumer<Type> or BiConsumer<Patient, Type> lambda which adds it to the resource.

The BiConsumer lambdas are needed to deal with special cases, such as adding Extensions to a resource as in the case for mother's maiden name, or birthDate when the converted result is more precise than to the day.

I want to make a parser annotation driven, so I've created a little annotation that serves both as documentation on the parser, as well as can drive the operation of the parse function.  So I came up with an annotation that is used like this on the PIDParser:

@ComesFrom(path="Patient.identifier", source = "PID-2")
@ComesFrom(path="Patient.identifier", source = "PID-3")
@ComesFrom(path="Patient.identifier", source = "PID-4")
@ComesFrom(path="Patient.name", source = "PID-5")
@ComesFrom(path=
    "Patient.extension('http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName')",
    source =
"PID-6")
@ComesFrom(path="Patient.birthDate", source = "PID-7")
@ComesFrom(path=
    "Patient.extension('http://hl7.org/fhir/StructureDefinition/patient-birthTime')",
    source =
"PID-7")

The path part of this annotation is written using the Simplified FHIRPath grammar defined in FHIR.  These paths can easily be traversed and set using the getNamedProperty() and setNamedProperty() of Element types.  A simple parse and traverse gets to the property, from which you can determine the type, and then call the appropriate converter on the field, which you can extract from the message by either parsing or using an HAPI V2 Terser on the source property.

I anticipate that ComesFrom will introduce new attributes as I determine patterns for them, for example to set a field to a fixed value, or translate a code from one code system to another before setting it via the destination consumer.  Another attribute may specific the name of a method in the parser to use as a lambda (accessed as a method via reflection on the parser itself).

ComesFrom annotations could obviously be written in CSV format, something like this used by the V2-to-FHIR project team to create the mapping spreadsheets.  In fact, what I'm doing right now for parsers is translating those spreadsheets by hand.  That will change VERY soon.

So, if I have ComesFrom annotations on my parsers, and a bunch of test messages, the next obvious (or maybe not-so-obvious) step is to parse the messages, and create the (almost) appropriate annotations to match those messages.  I did this later that day for the 60+ test messages in my initial test collection (which I expect to grow to by at least one if not two orders of magnitude).  Instead of the 100 assertions I started with that morning, I now have over 2775 that are almost complete.

Here's a small snippet of one:

MSH|^~\&|TEST|MOCK|DEST|DAPP|20240618083101-0400||RSP^K11^RSP_K11|RESULT-01|P|\
  2.5.1|||ER|AL|||||Z32^CDCPHINVS
  @MessageHeader.event.code.exists($this = "K11")
  @MessageHeader.meta.tag.code.exists($this = "RSP")
  @MessageHeader.definition.exists($this.endsWith("RSP_K11"))
  // ComesFrom(path="MessageHeader.source.sender", source = { "MSH-22", "MSH-4", "MSH-3"})
  @MessageHeader.source.sender.exists( \
    /* MSH-22 = null */ \
    /* MSH-4 = MOCK */ \
    /* MSH-3 = TEST */ \
  )
  // ComesFrom(path="MessageHeader.destination.receiver", source = { "MSH-23", "MSH-6", "MSH-5"})
  @MessageHeader.destination.receiver.exists( \
    /* MSH-23 = null */ \
    /* MSH-6 = DAPP */ \
    /* MSH-5 = DEST */ \
  ) 
  // ComesFrom(path="MessageHeader.source.sender.name", source = "MSH-4")
  @MessageHeader.source.sender.name.exists( \
    /* MSH-4 = MOCK */ \
  ) 
  // ComesFrom(path="MessageHeader.source.sender.endpoint", source = "MSH-3") 
  @MessageHeader.source.sender.endpoint.exists( \
    /* MSH-3 = TEST */ \
  )
  // ComesFrom(path="MessageHeader.destination.reciever.name", source = "MSH-6")
  @MessageHeader.destination.reciever.name.exists( \
    /* MSH-6 = DAPP */ \
  )
  // ComesFrom(path="MessageHeader.destination.reciever.endpoint", source = "MSH-5") 
  @MessageHeader.destination.reciever.endpoint.exists( \
    /* MSH-5 = DEST */ \
  )
  // ComesFrom(path="Bundle.timestamp", source = "MSH-7")
  @Bundle.timestamp.exists( 
    /* MSH-7 = 20240618083101-0400 */ 
  )

The stuff in comments (e.g., MSH-7 = 20240618083101-0400) lets the user know what message content is relevant for this assertion test.  Right now they (they = I) would have to manually change those values.  The corrected expression looks like this:

  @Bundle.timestamp.exists( 
    $this = "2024-06-18T08:31:01-04:00" 
  )

I'll get around to fixing that soon.  I have to be careful not to let the converter do the work of writing the test cases, because then they'll just be self-fulfilling prophecies instead of real tests.


Sunday, July 7, 2024

FHIRPath as a testing language

 I'm on a V2-to-FHIR journey writing some code to support translation of V2 messages to FHIR.

Along the way, one of the challenges I have is getting the testing framework set up so that it's easy to write assertions about conversions.  HL7 Messages are full of dense text, which makes it hard to read, and even harder to sprinkle them through with assertions, so that:

  1. The assertions about the FHIR translation are close to the HL7 Message text for which they are made (making it easy to verify that the right assertions are present).
  2. The text is loadable from external resources, rather than written in code.
  3. The assertions are written in a language that's easy to get parsing tools for, and 
  4. The assertion language works well with FHIR.
So, the last two are what leads to FHIRpath, which is obvious when you think about it.
FHIRPath is already in use for validating FHIR Resources, so here we go, just validating a bundle of resources.

The HAPI FHIRPath toolkit isn't quite as extensible as I'd look without digging into some of the guts (which I did some time back for FluentQuery), so about all I can do is write my own resource resolver to provide some customizations, even though I VERY MUCH WANT the ability to add constants and my own functions without having to rewrite some of the native R4 FhirPath code.  But, realistically, I just need to replace a few leading expressions to deal with my worst cases.

As a user, you want to write MessageHeader, or Patient, or Observation[3], or maybe even Bundle at the start of your tests.  For example: OperationOutcome.count() = 2.  But instead, you'd have to write something like %context.entry.resource.ofType(OperationOutcome).count() = 2.  Or in the case of the uniquitous Observation %context.entry.resource.ofType(Observation)[3] instead of just Observation[3].  It's about 30 characters added to each test you need to write, and just ONE message conversion probably needs about 500 assertions to fully validate it.  I'm at PID on my first example, and I've got about 100 assertions, and haven't hit the meat of the message yet.  That would be 3000 characters, or at my typing speed, about 8.5 minutes of extra typing.  I figure I can save about 5 seconds per assertion, and I've written 100 in one day.  According to Randal Monroe, I can invest 10 days into making that time savings happen.  Since it took me about an hour, I have 9 days of time to invest in something else (or I could just get back to work).


The next bit is about making HL7 messages easier to split into smaller pieces.  For now, a segment is small enough.  Segments are detectable by this regular expression pattern: /^[A-Z]{2}[A-Z0-9]/.  Any line that begins with that is a segment.  Great, now we're writing a parser (really a stream filter).

Now what?  Well, I need a way to identify assertions.  Let's use the @ character to introduce an assertion.  Anything followed by @ at the start of a line is an assertion, and it can be followed by a FHIRPath and an optional comment.  I suppose we could use # for comments, but FHIRpath already recognizes // comments, so I'll go with that.  Except that I have urls in my messages, and I don't want to have https:// urls split up after //.  So, I'll make the rule that the comment delimiter is two // followed by at least one space character.

Now, I'll borrow from some older programming languages and say that a terminal \ at the end of a line signals continuation of on the next line.  And it would be nice if \ plus some whitespace was the same as ending the line with a \, so I'll throw that in.  And finally, let's ignore leading and trailing whitespace on a line, because whitespace messes up messyages (yes, HL7 messages in text are messy).

Here's an example of how this might look in a message file:

MSH|^~\&|\
  TEST|MOCK|\
  DEST|DAPP|\
  20240618083101-0400||\
  RSP^K11^RSP_K11|\
  RESULT-01|\
  P|2.5.1|||\
  ER|AL|\
  ||||Z32^CDCPHINVS
@MessageHeader.count() = 1 // It has one message header
@MessageHeader.source.name = "TEST"
@MessageHeader.source.endpoint = "MOCK"
@MessageHeader.destination.name = "DEST"
@MessageHeader.destination.endpoint = "DAPP"

This is about where I'm at now.  Even better would be:

MSH|^~\&|\
  @MessageHeader.count() = 1 // It has one message header
  TEST|MOCK|\
  @MessageHeader.source.name = "TEST"
  @MessageHeader.source.endpoint = "MOCK"
  DEST|DAPP|\
  @MessageHeader.destination.name = "DEST"
  @MessageHeader.destination.endpoint = "DAPP"
  20240618083101-0400||\
  RSP^K11^RSP_K11|\
  RESULT-01|\
  P|2.5.1|||\
  ER|AL|\
  ||||Z32^CDCPHINVS

I'll get to that stage soon enough. I still have 9 more days to burn on automation. You can see though, how FHIRPath makes it easy to write the tests within your sample messages.


Thursday, June 27, 2024

The true edge cases of date/time parsing

 I'm in the process of developing a Java library to implement the V2-to-FHIR datatype conversions.  This is a core component for a V2 to FHIR converter I hope to open source at some point.

I'm using HAPI V2 and HAPI FHIR because Java, and these are the best implementations in Java.

Some interesting learnings:

  1.  HAPI  FHIR and HAPI V2 have overlapping acceptable input ranges.
    In order to provide the broadest support, I'm actually using both.  The V2 parser is easier to manage with the range of acceptable ISO-8601 date time strings, since it's easier to remove any existing punctuation from an ISO-8601 data type (the -, : and T characters that typically show up in XML and JSON time stamps), than it is to insert missing punctuation, so I go with that first with the input string normalized to the 8601 format w/o punctuation.
  2. There are a couple of wonky cases that HAPI FHIR parses but V2 doesn't.  If the hours, minutes or seconds are set to the string "-0", the strings parse in FHIR, but don't in V2.  I'm guessing someone is using parse by punctuation and that Integer.toString("-0") and getting 0 in the FHIR case.
  3. Another interesting case: calling new DateTimeType(s).getValueAsString() doesn't return the same string as the following in all cases (e.g., the "2024-06-25T-0:00:00" case).
         DateTimeType original = DateTimeType(s);
    DateTimeType normalized = new DateTimeType(original.getValue(), 
      original.getPrecision());
         assertEquals(original, normalized);
    This is because HAPI FHIR doesn't renormalize the input string if it is able to be parsed (but it probably should).  I've ensured my converter class does this renormalizing.  
  4. If a time zone isn't present, then it's assumed to be the local time zone in both HAPI V2 and HAPI FHIR.  This presents small problems in testing, but nothing insurmountable.
  5. While the value of 60 is allowed in seconds in FHIR, what HAPI FHIR actually does is role to the next minute.  Again, very edge case, as leap second events are infrequent in real life (only 27 since 1972), and even more so as detected as having impacts during code execution.  GPS aware applications have to deal with them because GPS time doesn't care about leap seconds (although your phone, which synchronizes it's time via GPS may correct for them).

For what it's worth as a side note, issue # 3 above happens with other types such as IntegerType, for example, try this test:
|
assertEquals(new IntegerType("01").getValueAsString(),
             new IntegerType(1).getValueAsString());

What I've done in my converter is after creating a value from a string, ensuring I perform any string-based construction like this:

IntegerType i = new IntegerType("01"); 
i.setValue(i.getValue());

This ensure that I get the expected string representation.  This helps resolve issues with leading zeros or plus signs (e.g., -01, 01, +01, +2).


Monday, February 21, 2022

Automating FHIR IG Generation from Non-FHIR Sources by cloning myself

An awesome lot of my FHIR IG development involves taking data in one structure and converting it to other structured formats required by the FHIR IG Development process.

That includes creating .fsh and .md files from structured data.

I do most of my FHIR IG development in Eclipse (because if it involves code or transforms, that's where my XML Editors plug in, or my Java transform code for other formats).  I've narrowed down my processes so that I can run Sushi, the FHIR Build or my "custom build script" from within eclipse with one of three external tool configuration scripts:

Here's my normal "Build" script, which just launches build.bat in the project root folder:

<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
    <stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="UTF-8"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${project}"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:\Windows\System32\cmd.exe"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="/c build.bat"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/></launchConfiguration>

Sometimes I just want to rebuild the IG, for that I can just call the IG Publisher:

<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
    <stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="UTF-8"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${project}"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:\jdk-11.0.2\bin\java.exe"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Xmx2G -jar ../publisher.jar -ig ig.ini -tx n/a"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
</launchConfiguration>

And sometimes I just want to rerun Sushi alone, without running FHIR:

<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
    <stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="UTF-8"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:\Program Files\nodejs\node.exe"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="C:\Users\kboone\AppData\Roaming\npm\node_modules\fsh-sushi\dist\app.js fsh -o ."/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
</launchConfiguration>

Save any of these snipped to a file named your-file-name.launch and you should be able to import it as an external tool configuration.

I've even gone so far (finally) as to make this build process an automated part of my check-ins to the FHIR Repository (that way I don't need to be present to run the scripts when source material changes).  What I usually do is take the command line (Windows) script and convert it to Unix and run it in GitHub CI/CD.  For V2-to-FHIR, I just recently created a CI/CD workflow that updates the Sushi from CSV files downloaded from Google Sheets.  This is all for publication purposes.  For SANER, I had other tools to create the SANER IG from an XML file I've been using for IG creation for IHE profiles.  Effectively what I'm doing is cloning myself using GitHub CICD.  I'm not even the first person in the community to do this.  It's basically how build.fhir.org runs, essentially as Grahame in-a-box, but it scales and neither I nor Grahame do.

We were running that up until a few weeks before final publication, after which we did all edits to the files created by the automated process, and removed all the code that supported that process.  That's because the FSH and FHIR IG content in GitHub are the official sources for the IG, not the process inputs used to generate them, and I don't want to be on the hook for maintenance for life for my own tooling that I'm using MOSTLY to make my life easier.

I've build now about 5 different guides using automated FHIR IG (and FSH generation tools).  It's the only way to fly when you have to turn dozens of structured inputs into FHIR IG outputs.


Tuesday, October 22, 2019

FHIR Terminology Datatype Usage Patterns

For the V2toFHIR project, I recently took up a task to write up my preferred approach for recording the original V2 code in FHIR Resources when mapping from a V2 message to FHIR.  To do that, I wanted to make a list of all the possible things that one might need to consider, so I ran a quick report of the variations in how code, Coding, and CodeableConcept are used with terminology in FHIR with respect to Binding Strength and Cardinality.

The report can be found at the bottom of the post.

Some interesting points:

code ~ required

The code datatype always uses a required vocabulary EXCEPT in one case in which it is preferred in Resource.language (which of course propagates to all resources in R4).  Now, why Resource.language says preferred instead of extensible is beyond me.  Who couldn't work with it as extensible?

max(cardinality(code)) is almost always 1

Instructive cases where there can be more than one code: AllergyIntolerance.category, Questionnaire.subjectType, CoverageEligibilityRequest.purpose and CoverageEligibilityResponse.purpose, anything dealing with daysOfWeek, and definition or conformance resources.  

The complete list where more than one can be used is AllergyIntolerance.category, CapabilityStatement.patchFormat, CapabilityStatement.rest.resource.referencePolicy, Endpoint.payloadMimeType, HealthcareService.availableTime.daysOfWeek, ImplementationGuide.definition.resource.fhirVersion
Location.hoursOfOperation.daysOfWeek, ObservationDefinition.permittedDataType, OperationDefinition.resource, PractitionerRole.availableTime.daysOfWeek, Questionnaire.subjectType, SearchParameter.comparator, SearchParameter.modifier, SearchParameter.target, StructureMap.group.rule.target.listMode, CapabilityStatement.format, 
CodeSystem.filter.operator, CoverageEligibilityRequest.purpose, CoverageEligibilityResponse.purpose, ImplementationGuide.fhirVersion, SearchParameter.base

Coding never uses required

The Coding data type is never bound with a required vocabulary, and rarely with a preferred one.  

Coding is not often used

In general, Coding is used 42 times, while CodableConcept is used 614 times. Hmm, do we really need Coding?  There are a few cases where I think the answer might be yes, but generally, I'd consider that most cases could probably survive quite well with just CodeableConcept.  In fact, in HL7 V2, CWE replaced ID/IS in the version 2.7 time frame throughout much of the specification.  There seem to be a small number of cases where Coding might be essential (QuestionnaireResponse.item.answer.value[x] could be one of these).

CodeableConcept has some interesting required cases

AdverseEvent.outcome, AdverseEvent.severity, AllergyIntolerance.clinicalStatus, AllergyIntolerance.verificationStatus, Condition.clinicalStatus, Condition.verificationStatus
These fields look mostly categorical and generally I have no complaints.  Seeing AdverseEvent.severity as a CodeableConcept makes me wonder though if AllergyIntolerance.criticality should also be CodeableConcept, or if the former should be code.

Measure.improvementNotation, MeasureReport.improvementNotation
The various improvementNotation attributes (on Measure and MeasureReport) could arguably be code.  I'm not sure what the use case is for CodableConcept in these.

EffectEvidenceSynthesis.effectEstimate.unitOfMeasure, 
ResearchElementDefinition.characteristic.unitOfMeasure, 
RiskEvidenceSynthesis.riskEstimate.unitOfMeasure
The unitOfMeasure fields above, when used alongside a decimal value argue that this information could have been modeled using SimpleQuantity to keep FHIR resources aligned around data types.

SupplyDelivery.type, InsurancePlan.plan.specificCost.benefit.cost.applicability, MolecularSequence.structureVariant.variantType
I don't have any feedback on these, just listing them for completeness.


Row Labels Count of Name
code 319
preferred 1
0..1 1
Resource.language 1
required 318
0..* 15
AllergyIntolerance.category 1
CapabilityStatement.patchFormat 1
CapabilityStatement.rest.resource.referencePolicy 1
Endpoint.payloadMimeType 1
HealthcareService.availableTime.daysOfWeek 1
ImplementationGuide.definition.resource.fhirVersion 1
Location.hoursOfOperation.daysOfWeek 1
ObservationDefinition.permittedDataType 1
OperationDefinition.resource 1
PractitionerRole.availableTime.daysOfWeek 1
Questionnaire.subjectType 1
SearchParameter.comparator 1
SearchParameter.modifier 1
SearchParameter.target 1
StructureMap.group.rule.target.listMode 1
0..1 112
ActivityDefinition.intent 1
ActivityDefinition.kind 1
ActivityDefinition.priority 1
AllergyIntolerance.criticality 1
AllergyIntolerance.reaction.severity 1
AllergyIntolerance.type 1
Appointment.participant.required 1
AuditEvent.action 1
AuditEvent.agent.network.type 1
AuditEvent.outcome 1
BiologicallyDerivedProduct.productCategory 1
BiologicallyDerivedProduct.status 1
BiologicallyDerivedProduct.storage.scale 1
Bundle.entry.search.mode 1
CapabilityStatement.rest.resource.conditionalDelete 1
CapabilityStatement.rest.resource.conditionalRead 1
CapabilityStatement.rest.resource.versioning 1
CarePlan.activity.detail.kind 1
CareTeam.status 1
CatalogEntry.status 1
ClaimResponse.processNote.type 1
CodeSystem.hierarchyMeaning 1
Communication.priority 1
CommunicationRequest.priority 1
Composition.confidentiality 1
Composition.section.mode 1
Consent.provision.type 1
Contract.status 1
DetectedIssue.severity 1
Device.status 1
Device.udiCarrier.entryType 1
DeviceMetric.calibration.state 1
DeviceMetric.calibration.type 1
DeviceMetric.color 1
DeviceMetric.operationalStatus 1
DeviceRequest.priority 1
DeviceRequest.status 1
DocumentReference.docStatus 1
EffectEvidenceSynthesis.resultsByExposure.exposureState 1
Encounter.location.status 1
EnrollmentRequest.status 1
EnrollmentResponse.outcome 1
EnrollmentResponse.status 1
EvidenceVariable.characteristic.groupMeasure 1
EvidenceVariable.type 1
ExplanationOfBenefit.processNote.type 1
ImplementationGuide.license 1
InsurancePlan.status 1
Location.mode 1
Location.status 1
Medication.status 1
MedicationKnowledge.status 1
MedicationRequest.priority 1
MessageDefinition.category 1
MessageDefinition.responseRequired 1
MolecularSequence.referenceSeq.orientation 1
MolecularSequence.referenceSeq.strand 1
MolecularSequence.type 1
ObservationDefinition.qualifiedInterval.category 1
ObservationDefinition.qualifiedInterval.gender 1
OperationDefinition.parameter.searchType 1
OperationDefinition.parameter.type 1
Patient.contact.gender 1
Patient.gender 1
PaymentReconciliation.outcome 1
PaymentReconciliation.processNote.type 1
Person.gender 1
Person.link.assurance 1
PlanDefinition.action.cardinalityBehavior 1
PlanDefinition.action.groupingBehavior 1
PlanDefinition.action.precheckBehavior 1
PlanDefinition.action.priority 1
PlanDefinition.action.requiredBehavior 1
PlanDefinition.action.selectionBehavior 1
Practitioner.gender 1
Questionnaire.item.enableBehavior 1
RelatedPerson.gender 1
RequestGroup.action.cardinalityBehavior 1
RequestGroup.action.groupingBehavior 1
RequestGroup.action.precheckBehavior 1
RequestGroup.action.priority 1
RequestGroup.action.requiredBehavior 1
RequestGroup.action.selectionBehavior 1
RequestGroup.priority 1
ResearchElementDefinition.characteristic.participantEffectiveGroupMeasure 1
ResearchElementDefinition.characteristic.studyEffectiveGroupMeasure 1
ResearchElementDefinition.variableType 1
SearchParameter.xpathUsage 1
ServiceRequest.priority 1
Specimen.status 1
StructureDefinition.derivation 1
StructureDefinition.fhirVersion 1
StructureMap.group.rule.source.listMode 1
StructureMap.group.rule.target.contextType 1
StructureMap.group.rule.target.transform 1
Subscription.channel.payload 1
Substance.status 1
SupplyDelivery.status 1
SupplyRequest.priority 1
SupplyRequest.status 1
Task.priority 1
TerminologyCapabilities.codeSearch 1
TestScript.setup.action.assert.contentType 1
TestScript.setup.action.assert.direction 1
TestScript.setup.action.assert.operator 1
TestScript.setup.action.assert.requestMethod 1
TestScript.setup.action.assert.resource 1
TestScript.setup.action.assert.response 1
TestScript.setup.action.operation.accept 1
TestScript.setup.action.operation.contentType 1
TestScript.setup.action.operation.method 1
TestScript.setup.action.operation.resource 1
1..* 6
CapabilityStatement.format 1
CodeSystem.filter.operator 1
CoverageEligibilityRequest.purpose 1
CoverageEligibilityResponse.purpose 1
ImplementationGuide.fhirVersion 1
SearchParameter.base 1
1..1 185
Account.status 1
ActivityDefinition.participant.type 1
ActivityDefinition.status 1
AdverseEvent.actuality 1
Appointment.participant.status 1
Appointment.status 1
AppointmentResponse.participantStatus 1
Binary.contentType 1
Bundle.entry.request.method 1
Bundle.type 1
CapabilityStatement.document.mode 1
CapabilityStatement.fhirVersion 1
CapabilityStatement.kind 1
CapabilityStatement.messaging.supportedMessage.mode 1
CapabilityStatement.rest.interaction.code 1
CapabilityStatement.rest.mode 1
CapabilityStatement.rest.resource.interaction.code 1
CapabilityStatement.rest.resource.searchParam.type 1
CapabilityStatement.rest.resource.type 1
CapabilityStatement.status 1
CarePlan.activity.detail.status 1
CarePlan.intent 1
CarePlan.status 1
CatalogEntry.relatedEntry.relationtype 1
ChargeItem.status 1
ChargeItemDefinition.propertyGroup.priceComponent.type 1
ChargeItemDefinition.status 1
Claim.status 1
Claim.use 1
ClaimResponse.outcome 1
ClaimResponse.status 1
ClaimResponse.use 1
ClinicalImpression.status 1
CodeSystem.content 1
CodeSystem.property.type 1
CodeSystem.status 1
Communication.status 1
CommunicationRequest.status 1
CompartmentDefinition.code 1
CompartmentDefinition.resource.code 1
CompartmentDefinition.status 1
Composition.attester.mode 1
Composition.relatesTo.code 1
Composition.status 1
ConceptMap.group.element.target.equivalence 1
ConceptMap.group.unmapped.mode 1
ConceptMap.status 1
Consent.provision.data.meaning 1
Consent.status 1
Contract.contentDefinition.publicationStatus 1
Coverage.status 1
CoverageEligibilityRequest.status 1
CoverageEligibilityResponse.outcome 1
CoverageEligibilityResponse.status 1
DetectedIssue.status 1
Device.deviceName.type 1
DeviceDefinition.deviceName.type 1
DeviceMetric.category 1
DeviceRequest.intent 1
DeviceUseStatement.status 1
DiagnosticReport.status 1
DocumentManifest.status 1
DocumentReference.relatesTo.code 1
DocumentReference.status 1
EffectEvidenceSynthesis.status 1
Encounter.status 1
Encounter.statusHistory.status 1
Endpoint.status 1
EpisodeOfCare.status 1
EpisodeOfCare.statusHistory.status 1
EventDefinition.status 1
Evidence.status 1
EvidenceVariable.status 1
ExampleScenario.actor.type 1
ExampleScenario.instance.resourceType 1
ExampleScenario.status 1
ExplanationOfBenefit.outcome 1
ExplanationOfBenefit.status 1
ExplanationOfBenefit.use 1
FamilyMemberHistory.status 1
Flag.status 1
Goal.lifecycleStatus 1
GraphDefinition.link.target.compartment.code 1
GraphDefinition.link.target.compartment.rule 1
GraphDefinition.link.target.compartment.use 1
GraphDefinition.link.target.type 1
GraphDefinition.start 1
GraphDefinition.status 1
Group.type 1
GuidanceResponse.status 1
ImagingStudy.status 1
Immunization.status 1
ImmunizationEvaluation.status 1
ImplementationGuide.definition.page.generation 1
ImplementationGuide.definition.parameter.code 1
ImplementationGuide.global.type 1
ImplementationGuide.status 1
Invoice.lineItem.priceComponent.type 1
Invoice.status 1
Library.status 1
Linkage.item.type 1
List.mode 1
List.status 1
Measure.status 1
MeasureReport.status 1
MeasureReport.type 1
Media.status 1
MedicationAdministration.status 1
MedicationDispense.status 1
MedicationRequest.intent 1
MedicationRequest.status 1
MedicationStatement.status 1
MessageDefinition.focus.code 1
MessageDefinition.status 1
MessageHeader.response.code 1
MetadataResource.status 1
MolecularSequence.quality.type 1
MolecularSequence.repository.type 1
NamingSystem.kind 1
NamingSystem.status 1
NamingSystem.uniqueId.type 1
NutritionOrder.intent 1
NutritionOrder.status 1
Observation.status 1
OperationDefinition.kind 1
OperationDefinition.parameter.binding.strength 1
OperationDefinition.parameter.use 1
OperationDefinition.status 1
OperationOutcome.issue.code 1
OperationOutcome.issue.severity 1
Patient.link.type 1
PaymentNotice.status 1
PaymentReconciliation.status 1
PlanDefinition.action.condition.kind 1
PlanDefinition.action.participant.type 1
PlanDefinition.action.relatedAction.relationship 1
PlanDefinition.status 1
Procedure.status 1
Provenance.entity.role 1
Questionnaire.item.enableWhen.operator 1
Questionnaire.item.type 1
Questionnaire.status 1
QuestionnaireResponse.status 1
RequestGroup.action.condition.kind 1
RequestGroup.action.relatedAction.relationship 1
RequestGroup.intent 1
RequestGroup.status 1
ResearchDefinition.status 1
ResearchElementDefinition.status 1
ResearchElementDefinition.type 1
ResearchStudy.status 1
ResearchSubject.status 1
RiskAssessment.status 1
RiskEvidenceSynthesis.status 1
SearchParameter.status 1
SearchParameter.type 1
ServiceRequest.intent 1
ServiceRequest.status 1
Slot.status 1
SpecimenDefinition.typeTested.preference 1
StructureDefinition.context.type 1
StructureDefinition.kind 1
StructureDefinition.status 1
StructureMap.group.input.mode 1
StructureMap.group.typeMode 1
StructureMap.status 1
StructureMap.structure.mode 1
Subscription.channel.type 1
Subscription.status 1
Task.intent 1
Task.status 1
TerminologyCapabilities.kind 1
TerminologyCapabilities.status 1
TestReport.participant.type 1
TestReport.result 1
TestReport.setup.action.assert.result 1
TestReport.setup.action.operation.result 1
TestReport.status 1
TestScript.status 1
ValueSet.compose.include.filter.op 1
ValueSet.status 1
VerificationResult.status 1
VisionPrescription.lensSpecification.eye 1
VisionPrescription.lensSpecification.prism.base 1
VisionPrescription.status 1
CodeableConcept 614
example 432
0..* 152
ActivityDefinition.bodySite 1
ActivityDefinition.topic 1
Appointment.serviceCategory 1
Appointment.serviceType 1
AuditEvent.agent.role 1
BodyStructure.locationQualifier 1
CarePlan.activity.detail.reasonCode 1
CarePlan.activity.outcomeCodeableConcept 1
CarePlan.category 1
CareTeam.category 1
CareTeam.participant.role 1
CareTeam.reasonCode 1
ChargeItem.bodysite 1
ChargeItem.reason 1
Claim.diagnosis.type 1
Claim.item.detail.modifier 1
Claim.item.detail.programCode 1
Claim.item.detail.subDetail.modifier 1
Claim.item.detail.subDetail.programCode 1
Claim.item.modifier 1
Claim.item.programCode 1
Claim.item.subSite 1
Claim.procedure.type 1
ClaimResponse.addItem.detail.modifier 1
ClaimResponse.addItem.detail.subDetail.modifier 1
ClaimResponse.addItem.modifier 1
ClaimResponse.addItem.programCode 1
ClaimResponse.addItem.subSite 1
ClinicalImpression.prognosisCodeableConcept 1
Communication.category 1
Communication.medium 1
Communication.reasonCode 1
CommunicationRequest.category 1
CommunicationRequest.medium 1
CommunicationRequest.reasonCode 1
Composition.category 1
Composition.event.code 1
Condition.bodySite 1
Condition.evidence.code 1
Consent.provision.action 1
Consent.provision.code 1
Contract.subType 1
Contract.term.action.performerType 1
Contract.term.action.reasonCode 1
Contract.term.asset.context.code 1
Contract.term.asset.periodType 1
Contract.term.asset.subtype 1
Contract.term.asset.type 1
Contract.term.offer.decisionMode 1
CoverageEligibilityRequest.item.modifier 1
CoverageEligibilityResponse.insurance.item.authorizationSupporting 1
CoverageEligibilityResponse.insurance.item.modifier 1
DetectedIssue.evidence.code 1
DeviceDefinition.safety 1
DeviceRequest.reasonCode 1
DiagnosticReport.category 1
DiagnosticReport.conclusionCode 1
DocumentReference.category 1
DocumentReference.context.event 1
EffectEvidenceSynthesis.topic 1
Encounter.hospitalization.dietPreference 1
Encounter.type 1
EpisodeOfCare.type 1
EventDefinition.topic 1
Evidence.topic 1
EvidenceVariable.topic 1
ExplanationOfBenefit.addItem.detail.modifier 1
ExplanationOfBenefit.addItem.detail.subDetail.modifier 1
ExplanationOfBenefit.addItem.modifier 1
ExplanationOfBenefit.addItem.programCode 1
ExplanationOfBenefit.addItem.subSite 1
ExplanationOfBenefit.diagnosis.type 1
ExplanationOfBenefit.item.detail.modifier 1
ExplanationOfBenefit.item.detail.programCode 1
ExplanationOfBenefit.item.detail.subDetail.modifier 1
ExplanationOfBenefit.item.detail.subDetail.programCode 1
ExplanationOfBenefit.item.modifier 1
ExplanationOfBenefit.item.programCode 1
ExplanationOfBenefit.item.subSite 1
ExplanationOfBenefit.procedure.type 1
FamilyMemberHistory.reasonCode 1
Flag.category 1
Goal.category 1
Goal.outcomeCode 1
HealthcareService.category 1
HealthcareService.characteristic 1
HealthcareService.program 1
HealthcareService.referralMethod 1
HealthcareService.serviceProvisionCode 1
HealthcareService.type 1
ImagingStudy.reasonCode 1
Immunization.programEligibility 1
Immunization.protocolApplied.targetDisease 1
Immunization.reasonCode 1
Immunization.subpotentReason 1
ImmunizationEvaluation.doseStatusReason 1
ImmunizationRecommendation.recommendation.contraindicatedVaccineCode 1
ImmunizationRecommendation.recommendation.forecastReason 1
ImmunizationRecommendation.recommendation.vaccineCode 1
InsurancePlan.type 1
Library.topic 1
Measure.topic 1
Media.reasonCode 1
MedicationAdministration.reasonCode 1
MedicationAdministration.statusReason 1
MedicationDispense.substitution.reason 1
MedicationKnowledge.intendedRoute 1
MedicationRequest.category 1
MedicationRequest.reasonCode 1
MedicationStatement.reasonCode 1
MedicationStatement.statusReason 1
NutritionOrder.excludeFoodModifier 1
NutritionOrder.foodPreferenceModifier 1
NutritionOrder.oralDiet.fluidConsistencyType 1
NutritionOrder.oralDiet.type 1
Observation.referenceRange.appliesTo 1
ObservationDefinition.category 1
ObservationDefinition.qualifiedInterval.appliesTo 1
Organization.type 1
OrganizationAffiliation.code 1
PlanDefinition.goal.addresses 1
PlanDefinition.topic 1
PractitionerRole.code 1
Procedure.bodySite 1
Procedure.complication 1
Procedure.followUp 1
Procedure.reasonCode 1
Procedure.usedCode 1
Provenance.agent.role 1
ResearchDefinition.topic 1
ResearchElementDefinition.topic 1
ResearchStudy.category 1
ResearchStudy.condition 1
ResearchStudy.focus 1
ResearchStudy.keyword 1
RiskEvidenceSynthesis.topic 1
Schedule.serviceCategory 1
Schedule.serviceType 1
ServiceRequest.bodySite 1
ServiceRequest.category 1
ServiceRequest.locationCode 1
ServiceRequest.orderDetail 1
ServiceRequest.reasonCode 1
Slot.serviceCategory 1
Slot.serviceType 1
SpecimenDefinition.collection 1
SpecimenDefinition.patientPreparation 1
SpecimenDefinition.typeTested.rejectionCriterion 1
SupplyRequest.reasonCode 1
VerificationResult.primarySource.communicationMethod 1
VerificationResult.primarySource.type 1
VerificationResult.validationProcess 1
0..1 209
Account.type 1
ActivityDefinition.code 1
ActivityDefinition.participant.role 1
ActivityDefinition.product[x] 1
AdverseEvent.event 1
AdverseEvent.seriousness 1
AdverseEvent.suspectEntity.causality.assessment 1
AdverseEvent.suspectEntity.causality.method 1
AllergyIntolerance.code 1
AllergyIntolerance.reaction.exposureRoute 1
AllergyIntolerance.reaction.substance 1
Appointment.cancelationReason 1
BiologicallyDerivedProduct.processing.procedure 1
BiologicallyDerivedProduct.productCode 1
BodyStructure.location 1
BodyStructure.morphology 1
CarePlan.activity.detail.code 1
CarePlan.activity.detail.product[x] 1
ChargeItem.performer.function 1
ChargeItem.product[x] 1
ChargeItemDefinition.code 1
Claim.careTeam.qualification 1
Claim.careTeam.role 1
Claim.diagnosis.onAdmission 1
Claim.diagnosis.packageCode 1
Claim.fundsReserve 1
Claim.item.bodySite 1
Claim.item.category 1
Claim.item.detail.category 1
Claim.item.detail.revenue 1
Claim.item.detail.subDetail.category 1
Claim.item.detail.subDetail.revenue 1
Claim.item.location[x] 1
Claim.item.revenue 1
Claim.related.relationship 1
Claim.subType 1
Claim.supportingInfo.code 1
Claim.supportingInfo.reason 1
ClaimResponse.addItem.bodySite 1
ClaimResponse.addItem.location[x] 1
ClaimResponse.formCode 1
ClaimResponse.fundsReserve 1
ClaimResponse.item.adjudication.reason 1
ClaimResponse.payeeType 1
ClaimResponse.payment.adjustmentReason 1
ClaimResponse.subType 1
ClinicalImpression.code 1
ClinicalImpression.finding.itemCodeableConcept 1
ClinicalImpression.statusReason 1
Communication.statusReason 1
Communication.topic 1
CommunicationRequest.statusReason 1
Composition.section.code 1
Condition.code 1
Condition.stage.summary 1
Condition.stage.type 1
Contract.contentDefinition.subType 1
Contract.contentDerivative 1
Contract.expirationType 1
Contract.scope 1
Contract.term.action.performerRole 1
Contract.term.action.subject.role 1
Contract.term.asset.scope 1
Contract.term.offer.type 1
Contract.term.subType 1
Contract.term.type 1
Contract.type 1
CoverageEligibilityRequest.item.category 1
CoverageEligibilityRequest.item.diagnosis.diagnosis[x] 1
CoverageEligibilityRequest.item.productOrService 1
CoverageEligibilityRequest.priority 1
CoverageEligibilityResponse.form 1
CoverageEligibilityResponse.insurance.item.category 1
CoverageEligibilityResponse.insurance.item.network 1
CoverageEligibilityResponse.insurance.item.productOrService 1
CoverageEligibilityResponse.insurance.item.term 1
CoverageEligibilityResponse.insurance.item.unit 1
Device.type 1
DeviceDefinition.type 1
DeviceRequest.parameter.code 1
DeviceRequest.performerType 1
DeviceUseStatement.bodySite 1
DocumentManifest.type 1
DocumentReference.context.facilityType 1
DocumentReference.context.practiceSetting 1
Encounter.hospitalization.dischargeDisposition 1
Encounter.hospitalization.reAdmission 1
Encounter.location.physicalType 1
Encounter.priority 1
Encounter.serviceType 1
ExplanationOfBenefit.addItem.bodySite 1
ExplanationOfBenefit.addItem.location[x] 1
ExplanationOfBenefit.benefitBalance.network 1
ExplanationOfBenefit.benefitBalance.term 1
ExplanationOfBenefit.benefitBalance.unit 1
ExplanationOfBenefit.careTeam.qualification 1
ExplanationOfBenefit.careTeam.role 1
ExplanationOfBenefit.diagnosis.onAdmission 1
ExplanationOfBenefit.diagnosis.packageCode 1
ExplanationOfBenefit.formCode 1
ExplanationOfBenefit.fundsReserve 1
ExplanationOfBenefit.fundsReserveRequested 1
ExplanationOfBenefit.item.adjudication.reason 1
ExplanationOfBenefit.item.bodySite 1
ExplanationOfBenefit.item.category 1
ExplanationOfBenefit.item.detail.category 1
ExplanationOfBenefit.item.detail.revenue 1
ExplanationOfBenefit.item.detail.subDetail.category 1
ExplanationOfBenefit.item.detail.subDetail.revenue 1
ExplanationOfBenefit.item.location[x] 1
ExplanationOfBenefit.item.revenue 1
ExplanationOfBenefit.payee.type 1
ExplanationOfBenefit.payment.adjustmentReason 1
ExplanationOfBenefit.payment.type 1
ExplanationOfBenefit.priority 1
ExplanationOfBenefit.related.relationship 1
ExplanationOfBenefit.subType 1
ExplanationOfBenefit.supportingInfo.code 1
FamilyMemberHistory.condition.outcome 1
FamilyMemberHistory.dataAbsentReason 1
Goal.start[x] 1
Goal.target.detail[x] 1
Goal.target.measure 1
Group.code 1
HealthcareService.eligibility.code 1
Immunization.fundingSource 1
Immunization.reportOrigin 1
Immunization.route 1
Immunization.site 1
Immunization.statusReason 1
ImmunizationRecommendation.recommendation.targetDisease 1
List.code 1
List.entry.flag 1
Location.physicalType 1
Media.bodySite 1
Media.modality 1
Media.view 1
Medication.code 1
Medication.form 1
MedicationAdministration.dosage.method 1
MedicationAdministration.dosage.route 1
MedicationAdministration.dosage.site 1
MedicationAdministration.performer.function 1
MedicationDispense.performer.function 1
MedicationDispense.statusReason[x] 1
MedicationDispense.substitution.type 1
MedicationDispense.type 1
MedicationKnowledge.code 1
MedicationKnowledge.doseForm 1
MedicationKnowledge.drugCharacteristic.type 1
MedicationKnowledge.packaging.type 1
MedicationRequest.courseOfTherapyType 1
MedicationRequest.performerType 1
MedicationRequest.statusReason 1
MedicationRequest.substitution.reason 1
MessageHeader.reason 1
MolecularSequence.quality.method 1
MolecularSequence.quality.standardSequence 1
MolecularSequence.referenceSeq.chromosome 1
MolecularSequence.referenceSeq.referenceSeqId 1
NutritionOrder.enteralFormula.additiveType 1
NutritionOrder.enteralFormula.baseFormulaType 1
NutritionOrder.oralDiet.nutrient.modifier 1
NutritionOrder.oralDiet.texture.foodType 1
NutritionOrder.oralDiet.texture.modifier 1
NutritionOrder.supplement.type 1
Observation.bodySite 1
Observation.method 1
ObservationDefinition.method 1
OperationOutcome.issue.details 1
PaymentNotice.paymentStatus 1
PaymentReconciliation.formCode 1
PlanDefinition.action.participant.role 1
PlanDefinition.goal.category 1
PlanDefinition.goal.start 1
PlanDefinition.goal.target.measure 1
Procedure.category 1
Procedure.code 1
Procedure.outcome 1
Procedure.performer.function 1
Procedure.statusReason 1
ResearchStudy.phase 1
ResearchStudy.reasonStopped 1
RiskAssessment.method 1
RiskAssessment.prediction.outcome 1
RiskAssessment.prediction.qualitativeRisk 1
ServiceRequest.asNeeded[x] 1
ServiceRequest.code 1
ServiceRequest.performerType 1
Specimen.collection.bodySite 1
Specimen.collection.method 1
Specimen.container.additive[x] 1
Specimen.container.type 1
Specimen.processing.procedure 1
Specimen.type 1
SpecimenDefinition.typeCollected 1
SpecimenDefinition.typeTested.container.cap 1
SpecimenDefinition.typeTested.container.material 1
SpecimenDefinition.typeTested.container.type 1
SpecimenDefinition.typeTested.handling.temperatureQualifier 1
SpecimenDefinition.typeTested.type 1
SupplyDelivery.suppliedItem.item[x] 1
SupplyRequest.category 1
SupplyRequest.parameter.code 1
Task.businessStatus 1
Task.code 1
Task.reasonCode 1
Task.statusReason 1
VerificationResult.attestation.communicationMethod 1
1..* 2
AllergyIntolerance.reaction.manifestation 1
Endpoint.payloadType 1
1..1 69
Basic.code 1
ChargeItem.code 1
Claim.diagnosis.diagnosis[x] 1
Claim.item.detail.productOrService 1
Claim.item.detail.subDetail.productOrService 1
Claim.item.productOrService 1
Claim.payee.type 1
Claim.priority 1
Claim.procedure.procedure[x] 1
Claim.supportingInfo.category 1
ClaimResponse.addItem.detail.productOrService 1
ClaimResponse.addItem.detail.subDetail.productOrService 1
ClaimResponse.addItem.productOrService 1
ClaimResponse.error.code 1
ClaimResponse.item.adjudication.category 1
ClaimResponse.payment.type 1
ClaimResponse.total.category 1
ClinicalImpression.investigation.code 1
Contract.contentDefinition.type 1
Contract.term.action.intent 1
Contract.term.action.status 1
Contract.term.action.type 1
Contract.term.offer.party.role 1
Coverage.costToBeneficiary.exception.type 1
CoverageEligibilityResponse.error.code 1
CoverageEligibilityResponse.insurance.item.benefit.type 1
DeviceRequest.code[x] 1
ExplanationOfBenefit.addItem.detail.productOrService 1
ExplanationOfBenefit.addItem.detail.subDetail.productOrService 1
ExplanationOfBenefit.addItem.productOrService 1
ExplanationOfBenefit.benefitBalance.category 1
ExplanationOfBenefit.benefitBalance.financial.type 1
ExplanationOfBenefit.diagnosis.diagnosis[x] 1
ExplanationOfBenefit.item.adjudication.category 1
ExplanationOfBenefit.item.detail.productOrService 1
ExplanationOfBenefit.item.detail.subDetail.productOrService 1
ExplanationOfBenefit.item.productOrService 1
ExplanationOfBenefit.procedure.procedure[x] 1
ExplanationOfBenefit.supportingInfo.category 1
ExplanationOfBenefit.total.category 1
FamilyMemberHistory.condition.code 1
FamilyMemberHistory.relationship 1
Flag.code 1
Goal.description 1
Group.characteristic.code 1
Group.characteristic.value[x] 1
Immunization.vaccineCode 1
ImmunizationEvaluation.doseStatus 1
ImmunizationEvaluation.targetDisease 1
ImmunizationRecommendation.recommendation.dateCriterion.code 1
ImmunizationRecommendation.recommendation.forecastStatus 1
MedicationAdministration.medication[x] 1
MedicationDispense.medication[x] 1
MedicationRequest.medication[x] 1
MedicationRequest.substitution.allowed[x] 1
MedicationStatement.medication[x] 1
Observation.code 1
Observation.component.code 1
ObservationDefinition.code 1
PaymentReconciliation.detail.type 1
PlanDefinition.goal.description 1
Practitioner.qualification.code 1
SpecimenDefinition.typeTested.container.additive.additive[x] 1
Substance.code 1
Substance.ingredient.substance[x] 1
SupplyRequest.item[x] 1
Task.input.type 1
Task.output.type 1
VisionPrescription.lensSpecification.product 1
extensible 116
0..* 54
ActivityDefinition.jurisdiction 1
AdverseEvent.category 1
Appointment.participant.type 1
AppointmentResponse.participantType 1
AuditEvent.agent.purposeOfUse 1
AuditEvent.purposeOfEvent 1
CapabilityStatement.jurisdiction 1
CapabilityStatement.rest.security.service 1
ChargeItemDefinition.jurisdiction 1
CodeSystem.jurisdiction 1
ConceptMap.jurisdiction 1
Condition.category 1
Device.statusReason 1
DocumentReference.securityLabel 1
EffectEvidenceSynthesis.certainty.certaintySubcomponent.rating 1
EffectEvidenceSynthesis.certainty.rating 1
EffectEvidenceSynthesis.jurisdiction 1
Encounter.participant.type 1
EventDefinition.jurisdiction 1
Evidence.jurisdiction 1
EvidenceVariable.jurisdiction 1
ExampleScenario.jurisdiction 1
GraphDefinition.jurisdiction 1
ImagingStudy.procedureCode 1
ImplementationGuide.jurisdiction 1
Library.jurisdiction 1
Location.type 1
Measure.jurisdiction 1
Measure.supplementalData.usage 1
Measure.type 1
MessageDefinition.jurisdiction 1
MetadataResource.jurisdiction 1
NamingSystem.jurisdiction 1
Observation.component.interpretation 1
Observation.interpretation 1
OperationDefinition.jurisdiction 1
Patient.contact.relationship 1
PlanDefinition.jurisdiction 1
Provenance.reason 1
Questionnaire.jurisdiction 1
ResearchDefinition.jurisdiction 1
ResearchElementDefinition.jurisdiction 1
ResearchStudy.location 1
RiskEvidenceSynthesis.certainty.certaintySubcomponent.rating 1
RiskEvidenceSynthesis.certainty.rating 1
RiskEvidenceSynthesis.jurisdiction 1
SearchParameter.jurisdiction 1
Specimen.condition 1
StructureDefinition.jurisdiction 1
StructureMap.jurisdiction 1
Substance.category 1
TerminologyCapabilities.jurisdiction 1
TestScript.jurisdiction 1
ValueSet.jurisdiction 1
0..1 54
ActivityDefinition.subject[x] 1
AuditEvent.agent.type 1
Claim.accident.type 1
Consent.policyRule 1
Contract.legalState 1
Contract.term.offer.decision 1
Coverage.costToBeneficiary.type 1
Coverage.relationship 1
EffectEvidenceSynthesis.certainty.certaintySubcomponent.type 1
EffectEvidenceSynthesis.effectEstimate.precisionEstimate.type 1
EffectEvidenceSynthesis.effectEstimate.type 1
EffectEvidenceSynthesis.effectEstimate.variantState 1
EffectEvidenceSynthesis.resultsByExposure.variantState 1
EffectEvidenceSynthesis.studyType 1
EffectEvidenceSynthesis.synthesisType 1
EventDefinition.subject[x] 1
ExplanationOfBenefit.accident.type 1
FamilyMemberHistory.sex 1
ImagingStudy.series.performer.function 1
Immunization.performer.function 1
InsurancePlan.contact.purpose 1
Library.subject[x] 1
Measure.compositeScoring 1
Measure.group.population.code 1
Measure.scoring 1
Measure.subject[x] 1
MeasureReport.group.population.code 1
MeasureReport.group.stratifier.stratum.population.code 1
Media.type 1
NamingSystem.type 1
NutritionOrder.enteralFormula.routeofAdministration 1
Observation.component.dataAbsentReason 1
Observation.dataAbsentReason 1
ObservationDefinition.qualifiedInterval.context 1
ObservationDefinition.quantitativeDetails.customaryUnit 1
ObservationDefinition.quantitativeDetails.unit 1
Organization.contact.purpose 1
Patient.maritalStatus 1
PlanDefinition.action.subject[x] 1
PlanDefinition.action.type 1
PlanDefinition.subject[x] 1
PlanDefinition.type 1
Provenance.activity 1
Provenance.agent.type 1
RequestGroup.action.type 1
ResearchDefinition.subject[x] 1
ResearchElementDefinition.subject[x] 1
ResearchStudy.primaryPurposeType 1
RiskEvidenceSynthesis.certainty.certaintySubcomponent.type 1
RiskEvidenceSynthesis.riskEstimate.precisionEstimate.type 1
RiskEvidenceSynthesis.riskEstimate.type 1
RiskEvidenceSynthesis.studyType 1
RiskEvidenceSynthesis.synthesisType 1
Specimen.collection.fastingStatus[x] 1
1..* 1
Consent.category 1
1..1 7
Claim.type 1
ClaimResponse.type 1
Consent.provision.actor.role 1
Consent.scope 1
Coverage.class.type 1
ExplanationOfBenefit.type 1
Library.type 1
preferred 52
0..* 16
Appointment.reasonCode 1
Appointment.specialty 1
Encounter.hospitalization.specialArrangement 1
Encounter.hospitalization.specialCourtesy 1
Encounter.reasonCode 1
HealthcareService.communication 1
HealthcareService.specialty 1
Observation.category 1
OrganizationAffiliation.specialty 1
Practitioner.communication 1
PractitionerRole.specialty 1
RelatedPerson.relationship 1
Schedule.specialty 1
Slot.specialty 1
Task.performerType 1
VerificationResult.primarySource.pushTypeAvailable 1
0..1 30
Appointment.appointmentType 1
ClaimResponse.processNote.language 1
Composition.section.emptyReason 1
Composition.section.orderedBy 1
Condition.severity 1
Coverage.type 1
DetectedIssue.code 1
DeviceMetric.unit 1
DocumentReference.type 1
Encounter.diagnosis.use 1
Encounter.hospitalization.admitSource 1
EpisodeOfCare.diagnosis.role 1
ExplanationOfBenefit.processNote.language 1
Goal.achievementStatus 1
Goal.priority 1
List.emptyReason 1
List.orderedBy 1
MedicationAdministration.category 1
MedicationDispense.category 1
MedicationStatement.category 1
Observation.referenceRange.type 1
PlanDefinition.goal.priority 1
Procedure.focalDevice.action 1
ResearchStudy.objective.type 1
Slot.appointmentType 1
VerificationResult.failureAction 1
VerificationResult.need 1
VerificationResult.primarySource.canPushUpdates 1
VerificationResult.primarySource.validationStatus 1
VerificationResult.validationType 1
1..1 6
Composition.type 1
DetectedIssue.mitigation.action 1
DeviceMetric.type 1
DiagnosticReport.code 1
Patient.communication.language 1
RelatedPerson.communication.language 1
required 14
0..1 14
AdverseEvent.outcome 1
AdverseEvent.severity 1
AllergyIntolerance.clinicalStatus 1
AllergyIntolerance.verificationStatus 1
Condition.clinicalStatus 1
Condition.verificationStatus 1
EffectEvidenceSynthesis.effectEstimate.unitOfMeasure 1
InsurancePlan.plan.specificCost.benefit.cost.applicability 1
Measure.improvementNotation 1
MeasureReport.improvementNotation 1
MolecularSequence.structureVariant.variantType 1
ResearchElementDefinition.characteristic.unitOfMeasure 1
RiskEvidenceSynthesis.riskEstimate.unitOfMeasure 1
SupplyDelivery.type 1
Coding 42
example 14
0..* 4
Contract.term.securityLabel.category 1
Contract.term.securityLabel.control 1
Questionnaire.code 1
Questionnaire.item.code 1
0..1 4
ExplanationOfBenefit.supportingInfo.reason 1
ImagingStudy.series.bodySite 1
ImagingStudy.series.laterality 1
QuestionnaireResponse.item.answer.value[x] 1
1..1 6
Contract.term.securityLabel.classification 1
MessageDefinition.event[x] 1
MessageHeader.event[x] 1
Questionnaire.item.answerOption.value[x] 1
Questionnaire.item.enableWhen.answer[x] 1
Questionnaire.item.initial.value[x] 1
extensible 25
0..* 8
AuditEvent.entity.securityLabel 1
AuditEvent.source.type 1
AuditEvent.subtype 1
Consent.provision.class 1
Consent.provision.purpose 1
Consent.provision.securityLabel 1
ImagingStudy.modality 1
StructureDefinition.keyword 1
0..1 8
AuditEvent.agent.media 1
AuditEvent.entity.lifecycle 1
AuditEvent.entity.role 1
AuditEvent.entity.type 1
CodeSystem.concept.designation.use 1
Contract.term.asset.relationship 1
TestScript.setup.action.operation.type 1
ValueSet.compose.include.concept.designation.use 1
1..1 9
AuditEvent.type 1
CapabilityStatement.messaging.endpoint.protocol 1
Encounter.class 1
Encounter.classHistory.class 1
Endpoint.connectionType 1
ImagingStudy.series.instance.sopClass 1
ImagingStudy.series.modality 1
TestScript.destination.profile 1
TestScript.origin.profile 1
preferred 3
0..1 2
DocumentReference.content.format 1
Location.operationalStatus 1
1..1 1
Contract.signer.type 1
Grand Total 975