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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
3 "sender": {
4 "hciCode": "S1234A",
5 "name": "Singapore General Hospital",
6 "block": "123",
7 "streetName": "Outram Road",
8 "buildingName": "Main Building",
9 "floorNumber": "5",
10 "unitNumber": "05-12",
11 "postalCode": "169608"
12 },
13 "senderSystem": "HAS",
14 "offering": {
15 "id": "offering-001",
16 "name": "Gastroenterology Consultation",
17 "institutionHciCode": "S1234A",
18 "institution": {
19 "hciCode": "S1234A",
20 "name": "Singapore General Hospital",
21 "block": "123",
22 "streetName": "Outram Road",
23 "buildingName": "Main Building",
24 "floorNumber": "5",
25 "unitNumber": "05-12",
26 "postalCode": "169608"
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": "Gastroenterology",
35 "nehrCode": "GASTRO123"
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": "Ang Mo Kio Avenue 3",
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. Lim Wei",
58 "email": "weilim@exampleclinic.sg",
59 "contactNumber": "98765432"
60 },
61 "isSubsidised": true,
62 "isUrgent": true,
63 "createdAt": "2024-05-01T00:00:00Z",
64 "updatedAt": "2024-05-01T00:00:00Z",
65 "formResponses": [
66 {
67 "question": "What are the patient's main symptoms?",
68 "id": "q1",
69 "answer": "Abdominal pain and nausea"
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 prefers morning appointments.",
84 "authorHciCode": "S1234A",
85 "authorName": "Dr. Lim Wei",
86 "createdAt": 1682899200,
87 "updatedAt": 1682899200
88 }
89 ],
90 "status": "draft",
91 "forms": [
92 {
93 "id": "form-001",
94 "url": "https://refer.health.gov.sg/forms/form-001",
95 "description": "Patient Medical History Form",
96 "isFilled": true,
97 "formResponses": [
98 {
99 "question": "Has the patient had any previous surgeries?",
100 "id": "q2",
101 "answer": "Appendectomy in 2010"
102 }
103 ],
104 "remark": "Please complete all sections",
105 "fields": [
106 {}
107 ],
108 "version": 1.1,
109 "migrated": true
110 }
111 ],
112 "url": "https://refer.health.gov.sg/referrals/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
113 "clinicLicenseNumber": "CLN1234567",
114 "clinicType": "CHAS-only",
115 "clinicalInfo": "Patient has a history of hypertension and is allergic to penicillin.",
116 "timeslotStartAt": "2024-05-10T09:00:00Z",
117 "appointmentLocation": "SGH Outram Road Clinic"
118}
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.
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