Skip to content

Smart Consultation Report Fields & UI Mapping ​

This document provides a comprehensive breakdown of all response fields, a full-tree JSON example, UI component mapping, and chunk assembly logic for the Smart Consultation Report (module_type = 1).

How to Obtain Reports

  • Method 1 (Recommended): Call GET /medical-record?session_id=<SESSION_ID> or ?report_id=<REPORT_ID> to retrieve the aggregated report object directly.
  • Method 2: Read the report_contents chunk array via task polling or detail endpoints, and perform Deep Merge on the frontend (see reference code at the bottom).

Complete Annotated Report JSON Tree (100% Full Structure) ​

Below is the fully expanded JSON schema showing all levels and leaf properties. Frontend developers can directly map this structure to TypeScript interfaces and component props:

json5
{
  /* ================= 1. Top-Level Metadata (medical_record Table) ================= */
  "id": 10086,                                 // [int] Primary record ID
  "session_id": "session_6407c5cc22f84c5a",     // [string] Associated consultation session ID
  "pet_profile_id": 44,                        // [int] Associated pet profile ID
  "module_type": 1,                            // [int] Module ID (1: Smart Consultation, 5: Image Recognition)
  "report_type": "v1",                            // [int] Report type (1: Routine Chief Complaint Report)
  "status": 2,                                 // [int] Status (0: Not started, 1: Generating, 2: Completed, 3: Failed)
  "summary": "The pet presented with frequent sneezing and watery nasal discharge...", // [string] Overall consultation dialogue summary
  "report_time": "2026-09-16 14:30:00",        // [string] Completion timestamp (YYYY-MM-DD HH:mm:ss)
  "lang": "en-US",                             // [string] Report language (zh-CN, en-US)

  /* ================= 2. Pet Card & Basic Profile (pet_info Object) ================= */
  "pet_info": {
    "id": 44,                                  // [int] Pet profile ID
    "name": "Mochi",                           // [string] Pet name
    "avatar": "https://oss.example.com/pet.jpg", // [string] Avatar image URL
    "pet_type": 1,                             // [int] Species enum (1: Cat, 2: Dog, 3: Other exotic)
    "pet_variety": "British Shorthair",        // [string] Breed name
    "gender": 1,                               // [int] Gender (1: Male, 2: Female, null: Unknown)
    "birthday": "2024-05-01",                  // [string] Birthdate (YYYY-MM-DD)
    "age": "1 yr 4 mos",                       // [string] Computed display age
    "weight": "4.5",                           // [string] Registered weight in kg
    "is_neutered": 1                           // [int] Neutered status (0: Unneutered, 1: Neutered, null: Unknown)
  },

  /* ================= 3. Core Report Contents (report Object / Merged Chunks) ================= */
  "report": {

    /* --- Chunk 1: Case Review (review · report_index = 1) --- */
    "review": {
      "chiefComplaint": "Frequent sneezing with clear nasal discharge, slight appetite drop for 2 days", // [string] Chief complaint (Primary issue)
      "symptoms": "Normal temp 38.6°C, occasional dry cough, fair spirits, no conjunctivitis, no vomiting/diarrhea" // [string] Detailed symptom progression
    },

    /* --- Chunk 2: Diagnosis & Recommended Checks (result · report_index = 2) --- */
    "result": {
      "diagnosis": {
        "suspected": "Feline Upper Respiratory Infection (Suspected FHV-1 or Mycoplasma)", // [string] Primary suspected disease title
        "severity_of_the_illness": "Medium",                   // [string] 4-level severity: Slight / Medium / Medium_high / Severe
        "probability_level": "high",                           // [string] Confidence: high / medium / low
        "description": "Feline Upper Respiratory Infection is a common contagious illness...", // [string] General medical explanation
        "basis": "Given the incomplete vaccination history and sudden onset of paroxysmal sneezing with catarrhal discharge..." // [string] AI clinical reasoning basis
      },
      "externalImage": ["五官", "皮肤"],                 // [string[]] Body-surface areas to highlight (Chinese values from a fixed list)
      "internalImage": ["气管", "肺部"],                   // [string[]] Internal organs to highlight (Chinese values from a fixed list)
      "skeletalImage": [],                                   // [string[]] Skeletal areas to highlight (empty array if normal)
      "EssentialCheckItems": "1. **Feline Respiratory 5-plex PCR**: Differentiate FHV, FCV, Chlamydia\n2. **Complete Blood Count (CBC)**: Assess inflammatory response", // [string] Essential clinic tests (Markdown supported)
      "RecommendCheckItems": "1. **Serum Amyloid A (SAA)**: Acute phase inflammatory marker\n2. **Thoracic X-ray (DR)**: Rule out secondary pneumonia",                // [string] Recommended secondary tests (Markdown supported)
      "other_suspected_diagnosis": [                          // [object[]] Differential diagnosis list
        {
          "suspected": "Allergic Rhinitis",                    // [string] Secondary disease name
          "severity_of_the_illness": "Slight",                // [string] Same 4-value enum as above
          "description": "Nasal mucosa hypersensitivity triggered by dust, pollen, or fumes.", // [string] Description
          "basis": "Consider if recent bentonite cat litter change or air freshener usage occurred." // [string] Differential basis
        }
      ]
    },

    /* --- Chunk 3: Multi-Stage Treatment Advice (advice · report_index = 3) --- */
    "advice": {
      "is_urgent": "0",                                      // [string] Emergency hospital alert flag ("1": Emergency alert banner, "0": Regular home care)

      /* [Tab 1] Initial Treatment Stage (Home Care / Early Phase) */
      "Initial_Treatment": {
        "KeyPoint": "Maintain warm ambient temperature and humidity, keep nostrils clear, prevent secondary bacterial infection", // [string] Stage key action
        "CheckPoint": "Watch closely for fever above 39.5°C, transition to yellow purulent discharge, or complete anorexia",     // [string] Owner warning signs
        "medications": [                                     // [object[]] Recommended medication/care measures
          {
            "type": "Medication",                            // [string] Category ("Medication" / "Diet" / "Care" / "Injection" / "Surgery")
            "cause": "Broad-spectrum coverage against Mycoplasma and secondary bacterial invaders", // [string] Clinical rationale
            "Info": {
              "name": "Doxycycline Tablets (Veterinary)",      // [string] Item/drug generic name
              "form": "Oral tablet",                          // [string|null] Dosage form
              "dosage": "5~10mg/kg, half tablet",             // [string|null] Weight-adjusted dosage
              "frequency": "Once daily",                      // [string|null] Frequency
              "duration": "5~7 consecutive days",             // [string|null] Treatment duration
              "detail": null,                                 // [string|null] Practical procedure details
              "additional_info": "Administer after meal; follow with 3~5ml warm water to prevent esophageal adhesion" // [string|null] Precautions
            }
          },
          {
            "type": "Care",
            "cause": "Humidify upper respiratory mucosa, loosen dry secretions, relieve nasal blockage",
            "Info": {
              "name": "Saline Nebulization",
              "form": null,
              "dosage": "Medical sterile saline 5ml",
              "frequency": "Twice daily",
              "duration": "15 minutes per session",
              "detail": "Use an ultrasonic medical nebulizer inside a well-ventilated enclosure box",
              "additional_info": "Stop immediately if the cat exhibits extreme panic or distress"
            }
          }
        ]
      },

      /* [Tab 2] Persistent Aggravation Stage (Unresolved Progression) */
      "Persistent_Aggravation": {
        "KeyPoint": "If fever rises or lethargy worsens after 48h home care, seek veterinary intervention promptly",
        "CheckPoint": "Severe lethargy, copious purulent ocular discharge preventing eye opening, tachypnea",
        "medications": [
          {
            "type": "Injection",
            "cause": "Boost host antiviral immune response and mitigate systemic inflammation",
            "Info": {
              "name": "Recombinant Feline Interferon Subcutaneous",
              "form": "Injectable solution",
              "dosage": "300,000~500,000 IU/dose",
              "frequency": "Every other day",
              "duration": "3 consecutive doses",
              "detail": "Must be administered subcutaneously by a licensed veterinary professional",
              "additional_info": "Do not attempt home self-injection"
            }
          }
        ]
      },

      /* [Tab 3] Intensive Treatment Stage (Critical Crisis Rescue) */
      "Intensive_Treatment": {
        "KeyPoint": "Critical medical crisis; transport immediately to emergency hospital for stabilization",
        "CheckPoint": "Open-mouth breathing, severe abdominal pumping, cyanotic/pale gums, total anorexia >24h",
        "medications": [
          {
            "type": "Care",
            "cause": "Rapidly relieve acute hypoxia and stabilize vital signs",
            "Info": {
              "name": "ICU Oxygen Therapy & Intensive Stabilization",
              "form": null,
              "dosage": null,
              "frequency": "Continuous monitoring",
              "duration": "Hospitalized ICU stay until spontaneous breathing normalizes",
              "detail": "Admit to thermo-regulated oxygen cage with FiO2 35%~40%",
              "additional_info": "Keep head extended during transport; minimize agitation and noise"
            }
          }
        ]
      }
    },

    /* --- Chunk 4: Veterinary Orders (vet_order · report_index = 4) --- */
    "vet_order": {
      "vet_advise": "1. **Environment**: Keep room temperature at 23~26°C with 50%~60% relative humidity. Avoid cold drafts.\n2. **Isolation**: Highly contagious among cats. Isolate from other household pets; disinfect food and water bowls with boiling water daily.\n3. **Diet**: Anorexia may occur due to loss of smell. Gently warm canned food to enhance aroma and stimulate feeding.", // [string] Nursing guidance (Markdown format)
      "follow_up": "If sneezing decreases and appetite improves after 48 hours, complete the 7-day course. If fever >39.5°C or dyspnea occurs within 2 days, return to clinic immediately." // [string] Follow-up timeframe
    },

    /* --- Chunk 7: Dietary Supplements (supplements · report_index = 7) --- */
    "supplements": [
      {
        "cause": "Essential amino acid supplementation competing with arginine to suppress viral replication",
        "Info": {
          "name": "Feline High-Purity L-Lysine Gel",
          "form": "Nutritional paste",
          "dosage": "2~3cm strip",
          "frequency": "1~2 times daily",
          "duration": "2~3 weeks through recovery",
          "detail": "Apply directly on paw for self-licking or mix into wet food",
          "additional_info": "Supplements serve supportive purposes and do not replace prescribed antivirals"
        }
      }
    ]
  }
}

Detailed Leaf-Level Field Dictionary ​

1. Top-Level Metadata & Pet Profile ​

Field PathTypeValues / EnumsDescriptionUI Location
idintegerPositive intUnique report IDHeader subtitle (e.g. Report #10086)
session_idstringStringConsultation session IDHeader meta or debug bar
pet_profile_idintegerPositive intAssociated pet-profile IDProfile link and analytics
module_typeinteger1: Smart Consultation
5: Image Recognition
Business module IDSelects the report template and render branch
report_typestringAlways "v1"Record-level report version; not the numeric report_type sent when creating a report taskVersion compatibility
langstringBCP 47, e.g. zh-CNReport languageUI copy language
statusinteger0: Not started
1: In progress
2: Completed
3: Failed
Generation statusControls skeleton / loading / error retry states
report_timestringYYYY-MM-DD HH:mm:ssCompletion timestampReport timestamp
summarystringTextDialogue summaryTop summary callout banner
pet_info.idintegerPositive intPet-profile IDCard link and analytics
pet_info.avatarstring/nullURLPet avatar URLRounded avatar in the hero card
pet_info.birthdaystring/nullYYYY-MM-DDDate of birthUsed to compute the displayed age
pet_info.namestringTextPet nameHero card bold title
pet_info.pet_typeinteger1: Cat
2: Dog
3: Other
Species enumControls pet avatar / icon (🐱 / 🐶 / 🐰)
pet_info.pet_varietystringTextBreed nameBreed pill tag
pet_info.genderinteger1: Male
2: Female
null: Unknown
Gender enumGender badge (♂ / ♀)
pet_info.agestringText (e.g. "1 yr 4 mos")Formatted ageAge pill tag
pet_info.weightstringText (e.g. "4.5")Body weight (kg)Weight pill tag
pet_info.is_neuteredinteger0: Unneutered
1: Neutered
null: Unknown
Spay/Neuter statusNeutered badge

2. Case Review (review · Chunk 1) ​

Field PathTypeDescriptionUI Location
review.chiefComplaintstringChief Complaint: The primary concern reported by the owner.Review card top prominent quote box
review.symptomsstringSymptom Progression: Detailed symptoms, duration, and observations.Body paragraph beneath chief complaint

3. Diagnosis & Testing (result · Chunk 2) ​

Core Diagnosis (result.diagnosis) ​

Field PathTypeValues / EnumsDescriptionUI Location
result.diagnosis.suspectedstringDisease namePrimary Suspected DiseaseCard main title
result.diagnosis.severity_of_the_illnessstringSlight
Medium
Medium_high
Severe
Severity Level (the Prompt allows only these 4 values)4-level colored badge:
• Slight: Green
• Medium: Yellow
• Medium_high: Orange
• Severe: Red
result.diagnosis.probability_levelstringhigh
medium
low
Diagnostic ConfidenceTop right confidence tag
result.diagnosis.descriptionstringMarkdown / TextPathology OverviewMain description paragraph
result.diagnosis.basisstringMarkdown / TextDiagnostic Rationale: AI reasoning steps."Clinical Rationale" shaded callout

Surface/Organ Highlighting & Testing ​

Field PathTypeDescriptionUI Behavior
result.externalImagestring[]Only these 7 values are possible: ["五官", "颈部", "背部", "尾部", "四肢", "腹部", "皮肤"] (empty array or multiple selections allowed). Values are always Chinese strings.Lights up the matching body-surface hot-spot layer
result.internalImagestring[]Only these 12 values are possible: ["肺部", "大脑", "气管", "心脏", "肝脏", "胃", "脾", "肾", "肠道", "生殖系统", "膀胱", "胰腺"]. Values are always Chinese strings.Lights up the matching internal-organ layer
result.skeletalImagestring[]Only these 6 values are possible: ["颅骨", "肋骨", "关节", "脊椎", "骨盆", "肢体骨"] (empty array hides the skeleton diagram). Values are always Chinese strings.Lights up the matching skeleton layer
result.EssentialCheckItemsstringEssential diagnostic tests (Markdown)"Essential Hospital Tests" with red star badges
result.RecommendCheckItemsstringRecommended secondary tests (Markdown)"Recommended Testing" list

Differential Diagnoses (result.other_suspected_diagnosis[]) ​

The array holds 1-2 items (the Prompt allows at most 2 and requires each to differ from the primary result.diagnosis.suspected); only one may be returned when information is limited.

Field PathTypeDescriptionUI Behavior
[].suspectedstringSecondary condition nameAccordion header
[].severity_of_the_illnessstringSecondary severity enumSeverity badge on accordion
[].descriptionstringDisease brief summaryExpanded content paragraph
[].basisstringDifferential reasoningExpanded rationale notes

4. Treatment Advice (advice · Chunk 3) ​

Field PathTypeValues / EnumsDescription & UI Behavior
advice.is_urgentstring"1": Urgent
"0": Non-urgent
Emergency Alert Flag: If "1", render a prominent red banner warning to seek immediate emergency care.
advice.Initial_TreatmentobjectStage ObjectCorresponds to [Tab 1: Initial / Home Care].
advice.Persistent_AggravationobjectStage ObjectCorresponds to [Tab 2: Unresolved Progression].
advice.Intensive_TreatmentobjectStage ObjectCorresponds to [Tab 3: Emergency Crisis].

Stage Object Properties (Identical across all 3 tabs): ​

Initial_Treatment is restricted by the Prompt to veterinary OTC drugs and must not contain "打针" (injection) items.

PropertyTypeDescriptionUI Behavior
KeyPointstringKey Action PrinciplesBlue/Green callout highlighting key medical goals.
CheckPointstringOwner Warning SignsYellow/Red callout listing danger indicators.
medicationsobject[]Action Measures ListRendered as a list of item cards.

Action Measures Detail (medications[]): ​

Field PathTypeValues / EnumsDescription
typestringPrompt-defined values are "药品" / "手术" / "饮食" / "打针" (Chinese); other Chinese labels such as "护理" may also appearCategory Tag: rendered as a category badge; fall back to a default style for unknown values instead of hard-coding branches.
causestringTextClinical Rationale: Underlying mechanism.
Info.namestringTextItem / Drug Generic Name: Bold item title.
Info.formstring | nullPrompt examples: 口服 / 注射 / 外用 / 滴眼 / 滴耳 / 吸入 (free text)Dosage Form: capsule tag next to the title.
Info.dosagestring | nulle.g. "half tablet"Single Dosage (adjusted for weight).
Info.frequencystring | nulle.g. "Once daily"Dosing Frequency.
Info.durationstring | nulle.g. "5~7 days"; the Prompt limits it to 8 Chinese charactersRecommended Duration.
Info.detailstring | nullTextProcedure Steps: Specific instructions for care/surgery.
Info.additional_infostring | nullText; for drugs it must include the classification tag 【兽用处方药】 (veterinary prescription) or 【兽用非处方药】 (veterinary OTC)Precautions & Warnings: muted note (e.g. "Give after food"); the classification tag can be rendered as a separate badge.

5. Veterinary Orders (vet_order · Chunk 4) ​

Field PathTypeDescriptionUI Component
vet_order.vet_advisestringVeterinary Nursing Guidelines: Ambient temp, isolation, feeding tips (Markdown)."Veterinarian Instructions" section
vet_order.follow_upstringFollow-up Timeline: Criteria for clinic re-examination."Follow-up & Recheck" card

6. Dietary Supplements (supplements · Chunk 7) ​

If no supplements are suggested, this array is empty [] and the section is hidden.

Field PathTypeDescription
[].causestringSupplement benefits and mechanism.
[].Info.namestringSupplement product / nutrient name.
[].Info.formstring | nullForm (paste, powder, liquid).
[].Info.dosagestring | nullFeeding amount per serving.
[].Info.frequencystring | nullDaily feeding frequency.
[].Info.durationstring | nullDuration cycle.
[].Info.detailstring | nullAdministration method.
[].Info.additional_infostring | nullDisclaimer that supplements do not replace prescription drugs; same shape as medications[].Info, but without the prescription/OTC classification tag.

Frontend Assembly Standard Logic (JavaScript Reference) ​

javascript
/**
 * Format and assemble the complete consultation report
 * @param {Object} responseData - data payload from API
 * @returns {Object} Normalized complete report data tree
 */
export function formatConsultationReport(responseData) {
  if (!responseData) return null;

  let report = responseData.report ? JSON.parse(JSON.stringify(responseData.report)) : {};

  if (Array.isArray(responseData.report_contents)) {
    const sortedContents = responseData.report_contents
      .slice()
      .sort((a, b) => (a.report_index || 0) - (b.report_index || 0));

    for (const part of sortedContents) {
      try {
        const parsed = typeof part.content === 'string' ? JSON.parse(part.content) : part.content;
        if (parsed && typeof parsed === 'object') {
          report = { ...report, ...parsed };
        }
      } catch (err) {
        console.warn(`[Report] Failed to parse chunk index=${part.report_index}:`, err);
      }
    }
  }

  return {
    meta: {
      id: responseData.id || responseData.report_id,
      sessionId: responseData.session_id,
      status: responseData.status,
      reportTime: responseData.report_time || responseData.created_at,
      summary: responseData.summary,
      lang: responseData.lang || 'en-US'
    },
    petInfo: responseData.pet_info || {},
    report: report
  };
}
最近更新

Qijie Open Platform · API Documentation