package clinicalimpression

import (
	"service/internal/interfaces/satusehat"
	"time"
)

func MapRequestToFHIR(req ClinicalImpressionRequest) satusehat.FHIRPayload {
	return satusehat.NewFHIRPayload("ClinicalImpression").
		Set("status", req.Status).
		Set("description", req.Description).
		Set("summary", req.Summary).
		Set("subject", map[string]interface{}{
			"reference": "Patient/" + req.PatientID,
			"display":   req.PatientName,
		}).
		Set("encounter", map[string]interface{}{"reference": "Encounter/" + req.EncounterID}).
		Set("assessor", map[string]interface{}{
			"reference": "Practitioner/" + req.PractitionerID,
			"display":   req.PractitionerName,
		}).
		Set("date", req.Date.Format(time.RFC3339))
}
