因为我们试图设置fhir通信的合作伙伴正在使用fhir模式的中间版本,所以他们正在发送并期望具有
organization
元素,而不是
managingOrganization
fhir.net API所期望的。
我已经对从业者和实践成员进行了子类划分,并使对象创建良好,所以从业者现在在我们的案例中有一个自定义的“thxpactionerRole”。没有遇到错误,我在子类中有所有的属性(见下文)。
但是,当我序列化为XML时,结果根本没有实际错误——看起来序列化程序几乎完全忽略了它。我猜fhir.net序列化程序会进行某种检查,以确保它们只序列化有效的fhir类型?或者子类中是否有我遗漏的东西可能会阻止它工作?
我要说的API在这里:
https://github.com/ewoutkramer/fhir-net-api/tree/develop
目标是能够在生成的XML/JSON中包含practitioner/practitionerRole/organization元素。
[FhirType("Practitioner", IsResource = true)]
[DataContract]
public partial class THXPractitioner : Hl7.Fhir.Model.Practitioner, System.ComponentModel.INotifyPropertyChanged
{
[FhirElement("practitionerRole", Order = 170)]
[Cardinality(Min = 0, Max = -1)]
[DataMember]
public List<THXPractitionerRoleComponent> THXPractitionerRole
{
get { if (_PractitionerRole == null) _PractitionerRole = new List<THXPractitionerRoleComponent>(); return _PractitionerRole; }
set { _PractitionerRole = value; OnPropertyChanged("PractitionerRole"); }
}
private List<THXPractitionerRoleComponent> _PractitionerRole;
[FhirType("PractitionerRoleComponent")]
[DataContract]
public partial class THXPractitionerRoleComponent : Hl7.Fhir.Model.Practitioner.PractitionerRoleComponent, System.ComponentModel.INotifyPropertyChanged, IBackboneElement
{
[NotMapped]
public override string TypeName { get { return "PractitionerRoleComponent"; } }
/// <summary>
/// Organization where the roles are performed
/// </summary>
[FhirElement("organization", Order = 40)]
[References("Organization")]
[DataMember]
public ResourceReference organization
{
get { return _organization; }
set { _organization = value; OnPropertyChanged("organization");}
}
private ResourceReference _organization;
}
这就是它的名字:
fhirpractitioner.THXPractitionerRole = new List<Model.THXPractitioner.THXPractitionerRoleComponent>()
{
new Model.THXPractitioner.THXPractitionerRoleComponent()
{
Extension = new List<Extension>()
{
new Extension()
{
Url = "[My Url]",
}
},
organization = new ResourceReference()
{
Reference = "asdfasfd"
,Display = "organization"
,DisplayElement= new FhirString("organization")
}
}
};
谢谢。