fixing issue optimasi

This commit is contained in:
gigihshs
2025-12-11 12:27:20 +07:00
parent 2f5f40bd88
commit 07bf03d40d
4 changed files with 60 additions and 28 deletions
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"net/http"
"os"
"satusehat-rssa/internal/constant"
"satusehat-rssa/internal/model"
"satusehat-rssa/pkg/httputil"
@@ -93,6 +94,12 @@ func (s *SpecimenRepository) CreateSpecimen(req model.SpecimenRequest) (map[stri
var data map[string]interface{}
req.ResourceType = constant.SpecimenResourceType
req.Identifier = []model.IdentifierSpecimen{}
req.Identifier = append(req.Identifier, model.IdentifierSpecimen{
System: "http://sys-ids.kemkes.go.id/specimen/" + os.Getenv("ORGANIZATION_ID"), // Set this if needed, or remove if not present in IdentifierObject
Value: "00001",
Assigner: model.AssignerSpecimen{Reference: "Organization/" + os.Getenv("ORGANIZATION_ID")},
})
// Setup Patient
var patient string
if req.Subject.Reference != "" {
@@ -287,6 +294,12 @@ func (s *SpecimenRepository) HandleCheckSpecimen(id string) ([]string, bool, err
func (s *SpecimenRepository) UpdateSpecimen(req model.SpecimenRequest) (map[string]interface{}, error) {
req.ResourceType = constant.SpecimenResourceType
req.Identifier = []model.IdentifierSpecimen{}
req.Identifier = append(req.Identifier, model.IdentifierSpecimen{
System: "http://sys-ids.kemkes.go.id/specimen/" + os.Getenv("ORGANIZATION_ID"), // Set this if needed, or remove if not present in IdentifierObject
Value: "00001",
Assigner: model.AssignerSpecimen{Reference: "Organization/" + os.Getenv("ORGANIZATION_ID")},
})
// Setup Patient
var patient string
if req.Subject.Reference != "" {