For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Home
    • About the Referral Exchange (RefX)
  • Getting Started
    • API Overview
    • Accessing our APIs
    • Authentication
    • Content Types
    • Request and Response Limits
    • Create and Edit Referrals
    • Print Referrals
    • List Referrals
    • Cancel & Withdraw Referrals
    • Timeline Events
    • Implementation Reference
  • Concepts
    • Referral Lifecycle & Statuses
    • Referral Notes
    • Browser Tab Handling
    • Referral Link
    • NEHR Integration
  • API Reference
      • DELDelete a draft referral
      • POSTCancel a referral
      • POSTConvert a referral to draft
    • Changelog
LogoLogo
API ReferenceUpdating Referrals

Convert a referral to draft

POST
/api/v1/referrals/:referralId/back-to-draft
POST
/api/v1/referrals/:referralId/back-to-draft
$curl -X POST https://dummy-url-see-smartcms-spec/api/v1/referrals/referralId/back-to-draft \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "institutionIdType": "hci",
> "institutionId": "S1234A"
>}'
1{
2 "id": "a3f1c9e2-4b7d-4f8a-9c2e-1d2f3b4a5c6d",
3 "sender": {
4 "hciCode": "S1234A",
5 "name": "Sunrise Medical Clinic",
6 "block": "123",
7 "streetName": "Health Avenue",
8 "buildingName": "Sunrise Medical Building",
9 "floorNumber": "5",
10 "unitNumber": "05-12",
11 "postalCode": "567890"
12 },
13 "senderSystem": "HAS",
14 "offering": {
15 "id": "off-9876",
16 "name": "General Surgery Consultation",
17 "institutionHciCode": "S1234A",
18 "institution": {
19 "hciCode": "S1234A",
20 "name": "Sunrise Medical Clinic",
21 "block": "123",
22 "streetName": "Health Avenue",
23 "buildingName": "Sunrise Medical Building",
24 "floorNumber": "5",
25 "unitNumber": "05-12",
26 "postalCode": "567890"
27 },
28 "system": "HAS",
29 "description": "Before proceeding with your referral, please refer to the [guidelines of referrals to this SOC](https://go.gov.sg/refx-nuhs-gastro-guidelines).",
30 "isActive": true,
31 "isSubsidisable": true,
32 "timeslotPolicy": "timeslot-required",
33 "category": "aac",
34 "specialty": "General Surgery",
35 "nehrCode": "GS123"
36 },
37 "patient": {
38 "uin": "S7654321D",
39 "name": "John Tan",
40 "phoneNumber": "91234567",
41 "dob": "1985-07-15",
42 "gender": "Male",
43 "chasStatus": "Orange",
44 "address": {
45 "postalCode": "560123",
46 "block": "45",
47 "streetName": "Maple Street",
48 "floorNumber": "12",
49 "unitNumber": "12-34"
50 },
51 "residentialStatus": "SC",
52 "nationality": "Singapore"
53 },
54 "referringDoctor": {
55 "mcr": "MCR1234567",
56 "idType": "mcr",
57 "name": "Dr. Emily Lim",
58 "email": "emily.lim@sunrisemed.sg",
59 "contactNumber": "98765432"
60 },
61 "isSubsidised": true,
62 "isUrgent": true,
63 "createdAt": "2024-05-01T00:00:00Z",
64 "updatedAt": "2024-05-02T10:15:00Z",
65 "formResponses": [
66 {
67 "question": "What is the primary reason for referral?",
68 "id": "q1",
69 "answer": "Abdominal pain and discomfort"
70 }
71 ],
72 "attachments": [
73 {
74 "url": "https://refer.health.gov.sg/attachments/ecg-report.png",
75 "name": "ecg-report.png"
76 }
77 ],
78 "coreStatus": "draft",
79 "isCancellable": true,
80 "notes": [
81 {
82 "id": "note-001",
83 "content": "Patient requested morning appointment.",
84 "authorHciCode": "S1234A",
85 "authorName": "Dr. Emily Lim",
86 "createdAt": 1683004800,
87 "updatedAt": 1683008400
88 }
89 ],
90 "status": "draft",
91 "submittedAt": "2024-05-01T00:00:00Z",
92 "forms": [
93 {
94 "id": "form-001",
95 "url": "https://refer.health.gov.sg/forms/form-001",
96 "description": "General Surgery Referral Form",
97 "isFilled": true,
98 "formResponses": [
99 {
100 "question": "Have you had any previous surgeries?",
101 "id": "q2",
102 "answer": "No"
103 }
104 ],
105 "remark": "Please complete all sections before submission.",
106 "fields": [
107 {}
108 ],
109 "version": 1.1,
110 "migrated": true
111 }
112 ],
113 "url": "https://refer.health.gov.sg/referrals/a3f1c9e2-4b7d-4f8a-9c2e-1d2f3b4a5c6d",
114 "clinicLicenseNumber": "CLN-2023-5678",
115 "clinicType": "CHAS-only",
116 "clinicalInfo": "Patient has a history of hypertension and is allergic to penicillin.",
117 "timeslotStartAt": "2024-05-10T09:00:00Z",
118 "appointmentLocation": "Sunrise Medical Clinic, 123 Health Avenue, #05-12"
119}
Was this page helpful?
Previous

Create a note for a referral

Next
Built with

Authentication

Authorizationstring

API key to authenticate for external integrations. Use the format: “ApiKey insert-token-here”

Path parameters

referralIdstringRequiredformat: "uuid"
Referral ID

Request

This endpoint expects an object.
institutionIdTypeenumRequired
The type of institution ID
Allowed values:
institutionIdstringRequired
The institution ID

Response

idstring
senderobject
senderSystemenum
offeringobject
patientobject
referringDoctorobject
isSubsidisedboolean
isUrgentboolean
createdAtstring

Created at (ISO datetime)

updatedAtstring

Updated at (ISO datetime)

formResponseslist of objects
attachmentslist of objects
coreStatusenum
isCancellableboolean
Whether this referral can be cancelled
noteslist of objects
statusenumDeprecated
Deprecated. Use coreStatus instead.
submittedAtstring

Submitted at (ISO datetime). Absent if the referral is a draft.

formslist of objects
List of forms required to complete the referral
urlstring
URL to view the referral
clinicLicenseNumberstring
Clinic license number
clinicTypeenum
Clinic type
Allowed values:
clinicalInfostring
Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc.
timeslotStartAtstring

Timeslot start time (ISO datetime)

appointmentLocationstring
Appointment location

Errors

401
Unauthorized Error