Reputation: 31
I am trying to derive all resources from reference(name "Resource" ) class to solve a problem(e.g In group Resource--> member : Resource(Patient|Practitioner|Device| Medication|Substance) 0..*).
I have taken identifier as a data member in reference class and derived all resource from this class using .NET. But problem is here, identifier is missing in Resources "Substance and Medication".How to solve this problem ??? please help
Regards
Upvotes: 1
Views: 1178
Reputation: 35477
You are confusing an Identifier
with a logical ID.
An Identifier
is a unique name given to a first class entity by some organisation. It has two major components a system
and a value
, where system
is the organisation and value
is the unique ID within the organisation. There can always be multiple identifiers for a first class entity. For example, a Patient can have a social security number and a passport number (http:irs.gov|xxx-xx-xxxx
and http:travel.state.gov|xxxxxxx
).
Not all FHIR resources have identifier, e.g. are not first class entities.
However, all FHIR resources have a logical ID.
This is the server assigned ID. It is usually a GUID
or some monotonically increasing integer.
I would suggest using @Ewout's C# library (https://github.com/ewoutkramer/fhir-net-api) for dealing with FHIR resource's data model and serialisation/deserialisation. Then you can just concentrate on business problem.
Upvotes: 5
Reputation: 1004
In FHIR we have two identifiers: the business identifiers (like a Patient number, order number) etcetera and a infrastructural REST identifier, which looks like http://someserver.org/Patient/3AF334-5 and which identifies a specific instance of a resource on a specific server. You can regard this as the "technical" or "database" key, and those identifiers are generated by the server, maybe by producing incremental numbers.
If you look at the contents of Resources in the specification, they will only show the business identifier (if a Resource has one). Of course, every instance of a Resource has a technical id, especially if it is published using REST. This id is not shown on the Resource, as it is considered "metadata", just like the resource's last update date and the login who has created the resource on the server.
If you are doing REST, the Resource's technical id is the URL at which you have retrieved the resource using GET. When you do a POST, you'll receive this id in the Location header. This means you'll have to keep the Resource's data (which is in the body) and the resources REST location together.
One way to do that is to use a class like ResourceEntry (which are Resource + metadata) from the reference implementation.
Upvotes: 3
Reputation: 3586
Identifier is not in the base resource, and so what you are trying to do can't be done, because, as you say, Substance and Medication don't have identifiers.
Upvotes: 2