FHIR:添加自定义扩展
FHIR : adding a custom extension
我想添加一个自定义扩展到我的日程安排资源。
在我的应用程序中,日程安排有访问动机(原因)。我知道有一个分类约会/遇到原因的列表,但我想使用我的。
我有这样的东西:
{
"resourceType":"Schedule",
"identifier":"logical_id",
"type":"schedule_speciality",
"actor":{
"practioner_id":"identifier",
"practioner_name":"practioner name"
},
"external_id":{
"extension":[
{
"url":"http://api.test.com/fhir/schedule/external_id",
"valueIdentifier":"external_id"
}
]
},
"visit_motives":{
"extension":[
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive3"
}
]
},
"practice_id":{
"extension":[
{
"url":"https://api.test.com/fhir/schedule/practice_id",
"valueIdentifier":"practice_id"
}
]
}
}
我不确定这部分:
"visit_motives":{
"extension":[
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive3"
}
]
}
这样添加扩展是否正确?一个特定的日程总是有多种访问动机,所以我必须列出它们。
我也见过这种事:
"visit_motives": {
"coding": [
{
"system": "https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"code": "visit_motive1"
}
]
}
哪一个是正确的还是我错了?
这里有几个问题:
在时间表上捕捉“原因”似乎很奇怪。时间表说明特定临床医生或诊所或其他资源何时可用。例如。 “史密斯博士从下午 1 点到 4 点接受预约 Mon/Wed/Fri”。因此,如果您要在资源上捕获原因,它会反映“史密斯博士为什么有时间表?”通常会为单个约会捕获原因。这是为计划访问保留特定插槽的资源。 Appointment 已经有一个元素 for reason,您可以自由使用自己的代码或只发送文本。
您有传递标识符的扩展,但 Schedule 已经有一个标识符元素。为什么要使用扩展而不是标准元素?请注意,您可以使用“系统”and/or“类型”组件来区分不同种类的标识符。
您将“标识符”、“类型”、“名称”等作为简单字符串发送 - 但它们是复杂的数据类型,因此您需要传达子元素
actor 是 Reference 类型——这意味着您需要指向 Practitioner 资源。您不能发送属性 in-line。 (如果 Practitioner 仅存在于附表的上下文中,您可以使用将使用内部引用的“包含”方法,但包含在此 use-case.
中似乎没有意义
您的扩展的 URL 包含 ValueSet,这是不正确的 - 扩展都是结构定义。此外,URL.
中不应该有 # 符号
您的扩展语法不正确。您不能在 FHIR 中引入新属性。所有扩展的 属性 名称只是“扩展”。你用 URL 来区分。所以你的语法应该是:
{
"resourceType":"Schedule",
"id":"logical_id",
"extension": [
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motive",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motive",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motives",
"valueString":"vist_motive3"
}
],
"identifier": [
{
"system": http://api.test.com/fhir/NamingSystem/external_id",
"value": "external_id"
}
{
"system": http://api.test.com/fhir/NamingSystem/practice_id",
"value": "practice_id"
}
]
"type": {
"coding": {
"system": "http://somewhere.org/fhir/CodeSystem/specialties",
"code": "schedule_speciality"
},
"text": "Some text description of specialty"
},
"actor":{
"reference": "http://myserver.org/fhir/Practitioner/12345"
"display": "Dr. smith"
}
}
我想添加一个自定义扩展到我的日程安排资源。 在我的应用程序中,日程安排有访问动机(原因)。我知道有一个分类约会/遇到原因的列表,但我想使用我的。
我有这样的东西:
{
"resourceType":"Schedule",
"identifier":"logical_id",
"type":"schedule_speciality",
"actor":{
"practioner_id":"identifier",
"practioner_name":"practioner name"
},
"external_id":{
"extension":[
{
"url":"http://api.test.com/fhir/schedule/external_id",
"valueIdentifier":"external_id"
}
]
},
"visit_motives":{
"extension":[
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive3"
}
]
},
"practice_id":{
"extension":[
{
"url":"https://api.test.com/fhir/schedule/practice_id",
"valueIdentifier":"practice_id"
}
]
}
}
我不确定这部分:
"visit_motives":{
"extension":[
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"valueString":"vist_motive3"
}
]
}
这样添加扩展是否正确?一个特定的日程总是有多种访问动机,所以我必须列出它们。
我也见过这种事:
"visit_motives": {
"coding": [
{
"system": "https://api.test.com/fhir/ValueSet/schedule#visit_motives",
"code": "visit_motive1"
}
]
}
哪一个是正确的还是我错了?
这里有几个问题:
在时间表上捕捉“原因”似乎很奇怪。时间表说明特定临床医生或诊所或其他资源何时可用。例如。 “史密斯博士从下午 1 点到 4 点接受预约 Mon/Wed/Fri”。因此,如果您要在资源上捕获原因,它会反映“史密斯博士为什么有时间表?”通常会为单个约会捕获原因。这是为计划访问保留特定插槽的资源。 Appointment 已经有一个元素 for reason,您可以自由使用自己的代码或只发送文本。
您有传递标识符的扩展,但 Schedule 已经有一个标识符元素。为什么要使用扩展而不是标准元素?请注意,您可以使用“系统”and/or“类型”组件来区分不同种类的标识符。
您将“标识符”、“类型”、“名称”等作为简单字符串发送 - 但它们是复杂的数据类型,因此您需要传达子元素
actor 是 Reference 类型——这意味着您需要指向 Practitioner 资源。您不能发送属性 in-line。 (如果 Practitioner 仅存在于附表的上下文中,您可以使用将使用内部引用的“包含”方法,但包含在此 use-case.
中似乎没有意义您的扩展的 URL 包含 ValueSet,这是不正确的 - 扩展都是结构定义。此外,URL.
中不应该有 # 符号您的扩展语法不正确。您不能在 FHIR 中引入新属性。所有扩展的 属性 名称只是“扩展”。你用 URL 来区分。所以你的语法应该是:
{
"resourceType":"Schedule",
"id":"logical_id",
"extension": [
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motive",
"valueString":"vist_motive1"
},
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motive",
"valueString":"vist_motive2"
},
{
"url":"https://api.test.com/fhir/StructureDefinition/schedule-visit_motives",
"valueString":"vist_motive3"
}
],
"identifier": [
{
"system": http://api.test.com/fhir/NamingSystem/external_id",
"value": "external_id"
}
{
"system": http://api.test.com/fhir/NamingSystem/practice_id",
"value": "practice_id"
}
]
"type": {
"coding": {
"system": "http://somewhere.org/fhir/CodeSystem/specialties",
"code": "schedule_speciality"
},
"text": "Some text description of specialty"
},
"actor":{
"reference": "http://myserver.org/fhir/Practitioner/12345"
"display": "Dr. smith"
}
}