123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390 |
- class FormObject {
- String? label;
- dynamic defaultValue;
- int? span;
- String? key;
- String? type;
- bool? border;
- dynamic disabledValue;
- List<Option>? options;
- List<FormObject>? children;
- String? append;
- String? placeholder;
- bool? required;
- bool? showLimit;
- String? parentKey;
- String? buttonName;
- List? childrenKey;
- List? groupKeys;
- List? exclusiveValue;
- int? maxItems;
- FormObject({
- this.label,
- this.defaultValue,
- this.span,
- this.key,
- this.type,
- this.border,
- this.disabledValue,
- this.options,
- this.children,
- this.append,
- this.placeholder,
- this.required,
- this.showLimit,
- this.parentKey,
- this.buttonName,
- this.childrenKey,
- this.groupKeys,
- this.exclusiveValue,
- this.maxItems,
- });
- factory FormObject.fromJson(Map<String, dynamic> json) {
- var optionsList = json['options'] == null ? null : json['options'] as List;
- List<Option>? options =
- optionsList?.map((item) => Option.fromJson(item)).toList();
- List<FormObject>? childrenItems;
- var children = json['children'];
- if (children is List) {
- childrenItems = [];
- for (var c in children) {
- if (c is FormObject) {
- childrenItems.add(c);
- } else {
- childrenItems.add(FormObject.fromJson(c as Map<String, dynamic>));
- }
- }
- } else {
- childrenItems = json['children'] != null
- ? List<FormObject>.from(json['children'])
- : null;
- }
- return FormObject(
- label: json['label'],
- defaultValue: json['defaultValue'],
- span: json['span'],
- key: json['key'],
- type: json['type'],
- border: json['border'],
- disabledValue: json['disabledValue'],
- options: options,
- children: childrenItems,
- append: json['append'],
- placeholder: json['placeholder'],
- required: json['required'],
- showLimit: json['show-limit'],
- parentKey: json['parentKey'],
- buttonName: json['buttonName'],
- childrenKey:
- json['childrenKey'] == null ? null : json['childrenKey'] as List,
- groupKeys: json['groupKeys'] == null ? null : json['groupKeys'] as List,
- exclusiveValue: json['exclusiveValue'] == null
- ? null
- : json['exclusiveValue'] as List,
- maxItems: json['maxItems'],
- );
- }
- Map<String, dynamic> toJson() {
- List<Map<String, dynamic>> optionsList =
- options != null ? options!.map((item) => item.toJson()).toList() : [];
- return {
- 'label': label,
- 'defaultValue': defaultValue,
- 'span': span,
- 'key': key,
- 'type': type,
- 'border': border,
- 'disabledValue': disabledValue,
- 'options': optionsList,
- 'children': children,
- 'append': append,
- 'placeholder': placeholder,
- 'required': required,
- 'show-limit': showLimit,
- 'parentKey': parentKey,
- 'buttonName': buttonName,
- 'childrenKey': childrenKey,
- 'groupKeys': groupKeys,
- 'exclusiveValue': exclusiveValue,
- 'maxItems': maxItems,
- };
- }
- }
- class Option {
- String? label;
- String? value;
- Option({this.label, this.value});
- factory Option.fromJson(Map<String, dynamic> json) {
- return Option(
- label: json['label'],
- value: json['value'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'label': label,
- 'value': value,
- };
- }
- }
- class ToxicSubstance {
- String? label;
- Map? value;
- ToxicSubstance({this.label, this.value});
- factory ToxicSubstance.fromJson(Map<String, dynamic> json) {
- return ToxicSubstance(
- label: json['label'],
- value: json['value'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'label': label,
- 'value': value,
- };
- }
- }
- class MenuItem {
- // 显示的文本
- String label;
- // 选中的值
- dynamic value;
- // 是否选中
- bool checked;
- MenuItem({this.label = '', this.value, this.checked = false});
- }
- /// 住院史表单数据类型
- class Admission {
- String? id;
- String? admissionDate;
- String? dischargeDate;
- String? reason;
- String? nameOfMedicalInstitution;
- String? patientNumber;
- Admission({
- this.id,
- this.admissionDate,
- this.dischargeDate,
- this.reason,
- this.nameOfMedicalInstitution,
- this.patientNumber,
- });
- factory Admission.fromJson(Map<String, dynamic> json) {
- return Admission(
- id: json['id'],
- admissionDate: json['Admission_Date'],
- dischargeDate: json['Discharge_Date'],
- reason: json['Reason'],
- nameOfMedicalInstitution: json['Name_Of_Medical_Institution'],
- patientNumber: json['Patient_Number'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'id': id ?? '',
- 'Admission_Date': admissionDate ?? '',
- 'Discharge_Date': dischargeDate ?? '',
- 'Reason': reason ?? '',
- 'Name_Of_Medical_Institution': nameOfMedicalInstitution ?? '',
- 'Patient_Number': patientNumber ?? '',
- };
- }
- }
- /// 家庭病床史
- class BedConstruction {
- String? id;
- String? bedConstructionDate;
- String? dischargeDate;
- String? reason;
- String? nameOfMedicalInstitution;
- String? patientNumber;
- BedConstruction({
- this.id,
- this.bedConstructionDate,
- this.dischargeDate,
- this.reason,
- this.nameOfMedicalInstitution,
- this.patientNumber,
- });
- factory BedConstruction.fromJson(Map<String, dynamic> json) {
- return BedConstruction(
- id: json['id'],
- bedConstructionDate: json['Bed_Construction_Date'],
- dischargeDate: json['Discharge_Date'],
- reason: json['Reason'],
- nameOfMedicalInstitution: json['Name_Of_Medical_Institution'],
- patientNumber: json['Patient_Number'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'id': id ?? '',
- 'Bed_Construction_Date': bedConstructionDate ?? '',
- 'Discharge_Date': dischargeDate ?? '',
- 'Reason': reason ?? '',
- 'Name_Of_Medical_Institution': nameOfMedicalInstitution ?? '',
- 'Patient_Number': patientNumber ?? '',
- };
- }
- }
- /// 主要用药情况
- class MainMedication {
- String? id;
- String? medicineName;
- String? medicineUsage;
- String? medicineDosage;
- String? medicineTime;
- String? medicineCompliance;
- MainMedication({
- this.id,
- this.medicineName,
- this.medicineUsage,
- this.medicineDosage,
- this.medicineTime,
- this.medicineCompliance,
- });
- factory MainMedication.fromJson(Map<String, dynamic> json) {
- return MainMedication(
- id: json['id'],
- medicineName: json['Medicine_Name'],
- medicineUsage: json['Medicine_Usage'],
- medicineDosage: json['Medicine_Dosage'],
- medicineTime: json['Medicine_Time'],
- medicineCompliance: json['Medicine_Compliance'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'id': id ?? '',
- 'Medicine_Name': medicineName ?? '',
- 'Medicine_Usage': medicineUsage ?? '',
- 'Medicine_Dosage': medicineDosage ?? '',
- 'Medicine_Time': medicineTime ?? '',
- 'Medicine_Compliance': medicineCompliance ?? '',
- };
- }
- }
- /// 预防接种史
- class VaccinationHistory {
- String? id;
- String? vaccinationDate;
- String? vaccinationFacility;
- String? vaccineName;
- VaccinationHistory({
- this.id,
- this.vaccinationDate,
- this.vaccinationFacility,
- this.vaccineName,
- });
- factory VaccinationHistory.fromJson(Map<String, dynamic> json) {
- return VaccinationHistory(
- id: json['id'],
- vaccinationDate: json['Vaccination_Date'],
- vaccinationFacility: json['Vaccination_Facility'],
- vaccineName: json['Vaccine_Name'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'id': id ?? '',
- 'Vaccination_Date': vaccinationDate ?? '',
- 'Vaccination_Facility': vaccinationFacility ?? '',
- 'Vaccine_Name': vaccineName ?? '',
- };
- }
- }
- class EditTableValue {
- int? id;
- Map<String, dynamic>? value;
- EditTableValue({
- this.id,
- this.value,
- });
- }
- class DangerFrequency {
- String? frequency;
- String? value;
- DangerFrequency({this.frequency, this.value});
- factory DangerFrequency.fromJson(Map<String, dynamic> json) {
- return DangerFrequency(
- frequency: json['frequency'],
- value: json['value'],
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'frequency': frequency,
- 'value': value,
- };
- }
- }
- class MedicationModel {
- ///名字
- String? name;
- ///用法
- String? usage;
- ///月或日
- String? monthOrDay;
- ///剂量
- String? dosages;
- MedicationModel({this.name, this.monthOrDay, this.usage, this.dosages});
- factory MedicationModel.fromJson(Map<String, dynamic> json) {
- return MedicationModel(
- name: json['name'] ?? "",
- usage: json['usage'] ?? "",
- monthOrDay: json['monthOrDay'] ?? "",
- dosages: json['dosages'] ?? "",
- );
- }
- Map<String, dynamic> toJson() {
- return {
- 'name': name ?? '',
- 'usage': usage ?? '',
- 'monthOrDay': monthOrDay ?? '',
- 'dosages': dosages ?? '',
- };
- }
- }
|