ConsultationType
Dealing With ConsultationType
In order to deal with the Consultations and the functionality related to consultations, we use the interface ConsultationType
interface ConsultationType {
id?: number;
userId?: number;
question?: string;
doctorName?: string;
doctorAvatar?: string;
medium?: string;
status?: string;
isFulfilled?: number;
parentConsultationId?: number;
createdAt?: string;
updatedAt?: string;
user?: UserType;
parentConsultation?: ConsultationType;
media?: MediaType[];
consultations?: ConsultationType[];
chatConfig?: ChatConfig;
voipConfig?: VoipConfig;
videoConfig?: VoipConfig;
chatHistory: ChatHistory;
recommendation?: Recommendation;
socketParams?: SocketParams;
doctorAverageRating?: number;
}
Consultation related types
Also, there are some pre-defined types included in the ConsultationType interface
MediaType
The consultation data might include some media files related to the consultation represented as MediaType array and here is the MediaType interface
interface MediaType {
id?: string;
type?: string;
name?: string;
path?: string;
extension?: string;
url?: string;
size?: number;
}
ChatConfig
The ChatConfig object contains the data related to chat consultations, here is the ChatConfig interface
interface ChatConfig {
id?: number;
consultation_id?: number;
group_id?: String;
chat_user_id?: String;
app_id?: String;
chat_user_token?: String;
}
VoipConfig
The VoipConfig object contains the data related to Video or Voip consultations, here is the VoipConfig interface
interface VoipConfig {
id?: number;
consultation_id?: number;
apiKey?: string;
call_id?: string;
token?: string;
}
ChatHistory
The ChatHistory object contains the data related to chat history of chat consultations, here is the ChatHistory interface
interface ChatHistory {
id?: number;
consultation_id?: number;
data?: ChatData[];
created_at?: string;
updated_at?: string;
}
The data array of ChatHistory object is an array of ChatData type, and here is the ChatData interface
interface ChatData {
id?: string;
message?: string;
sent_at?: string;
chat_user_id?: string;
}
Recommendation
The Recommendation object contains the recommendation data filled by the doctor, here is the Recommendation interface
interface Recommendation {
id?: number;
consultation_id?: number;
data?: RecommendationData;
created_at?: string;
updated_at?: string;
}
The data of the Recommendation object is an object of RecommendationData type and here is the RecommendationData interface
interface RecommendationData {
lab?: RecommendationLab;
drug?: RecommendationDrug;
icd10?: RecommendationICD10;
followUp?: RecommendationFollowUp[] | null;
doctorReferral?: RecommendationDoctorReferral;
postCallAnswer?: RecommendationPostCallAnswer[] | null;
}
Each field of the RecommendationData object is a pre-defined type and here are all the interfaces related to RecommendationData object
RecommendationLab The RecommendationLab field contains an array of labs prescribed after the consultation
interface RecommendationLab {
lab?: RecommendationLabItem[] | null;
panel?: RecommendationLabItem[] | null;
}
And here is the RecommendationLabItem interface related to RecommendationLab
interface RecommendationLabItem {
name?: string;
}
RecommendationDrug The RecommendationDrug field contains an array of fdaDrugs prescribed after the consultation
interface RecommendationDrug {
fdaDrug?: RecommendationFdaDrug[] | null;
}
And here is the RecommendationFdaDrug interface related to RecommendationDrug
interface RecommendationFdaDrug {
name?: string;
dosage?: string;
duration?: number;
howToUse?: string;
frequency?: string;
tradeName?: string;
dosageForm?: string;
dosageUnit?: string;
packageSize?: string;
packageType?: string;
strengthValue?: string;
relationWithFood?: string;
specialInstructions?: string;
routeOfAdministration?: string;
}
RecommendationICD10 The RecommendationICD10 field contains an array of symptoms and array of diagnosis defined after the consultation
interface RecommendationICD10 {
symptom?: RecommendationSymptom[] | null;
diagnosis?: RecommendationDiagnosis[] | null;
}
And here are the RecommendationSymptom and RecommendationDiagnosis interfaces related to RecommendationICD10
interface RecommendationSymptom {
code?: string;
name?: string;
}
interface RecommendationDiagnosis {
code?: string;
name?: string;
}
RecommendationFollowUp The RecommendationFollowUp field is an array of follow-ups related to the consultation
interface RecommendationFollowUp {
name?: string;
}
RecommendationDoctorReferral The RecommendationDoctorReferral field is an object contains the referral speciality recommended in the consultation
interface RecommendationDoctorReferral {
name?: string;
}
RecommendationPostCallAnswer The RecommendationPostCallAnswer field is an array of predefined questions answered in the recommendation
interface RecommendationPostCallAnswer {
answer?: string;
question?: string;
}
Consultation Functionalities
The following are the functionalities relate to consultations
APi | Params |
---|---|
createConsultation | consultationData : ConsultationObject |
getConsultationInfo | consultation_id: number |
getLastConsultation | |
getConsultationList | user_id: number (required), page: number, perPage: number |
deleteConsultation | consultation_id: number |
cancelConsultation | consultation_id: number |
uploadMedia | path: string, type: string, fileName: string |