update All feture and service
This commit is contained in:
No files matched your search
@@ -1,7 +1,6 @@
|
||||
package allergyintolerance
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -19,15 +18,10 @@ var verificationStatusDisplayMap = map[string]string{
|
||||
func MapRequestToFHIR(req AllergyIntoleranceRequest) satusehat.FHIRPayload {
|
||||
payload := satusehat.NewFHIRPayload("AllergyIntolerance")
|
||||
|
||||
orgID := os.Getenv("SATUSEHAT_ORG_ID")
|
||||
if orgID == "" {
|
||||
orgID = req.OrganizationID
|
||||
}
|
||||
|
||||
if orgID != "" && req.AllergyID != "" {
|
||||
if req.OrganizationID != "" && req.AllergyID != "" {
|
||||
payload.Set("identifier", []map[string]interface{}{
|
||||
{
|
||||
"system": "http://sys-ids.kemkes.go.id/allergy/" + orgID,
|
||||
"system": "http://sys-ids.kemkes.go.id/allergy/" + req.OrganizationID,
|
||||
"use": "official",
|
||||
"value": req.AllergyID,
|
||||
},
|
||||
@@ -58,29 +52,25 @@ func MapRequestToFHIR(req AllergyIntoleranceRequest) satusehat.FHIRPayload {
|
||||
})
|
||||
}
|
||||
|
||||
if len(req.Category) > 0 {
|
||||
payload.Set("category", req.Category)
|
||||
if req.Category != "" {
|
||||
payload.Set("category", []string{req.Category})
|
||||
}
|
||||
|
||||
if req.Code != nil {
|
||||
sys := req.Code.System
|
||||
if req.Code != "" {
|
||||
sys := req.CodeSystem
|
||||
if sys == "" {
|
||||
sys = "http://snomed.info/sct" // Default to SNOMED
|
||||
sys = "http://snomed.info/sct"
|
||||
}
|
||||
coding := map[string]interface{}{
|
||||
"system": sys,
|
||||
"code": req.Code.Code,
|
||||
"code": req.Code,
|
||||
}
|
||||
if req.Code.Display != "" {
|
||||
coding["display"] = req.Code.Display
|
||||
if req.CodeDisplay != "" {
|
||||
coding["display"] = req.CodeDisplay
|
||||
}
|
||||
codeConcept := map[string]interface{}{
|
||||
payload.Set("code", map[string]interface{}{
|
||||
"coding": []map[string]interface{}{coding},
|
||||
}
|
||||
if req.Code.Text != "" {
|
||||
codeConcept["text"] = req.Code.Text
|
||||
}
|
||||
payload.Set("code", codeConcept)
|
||||
})
|
||||
}
|
||||
|
||||
if req.PatientID != "" {
|
||||
|
||||
Reference in New Issue
Block a user