Data Characteristics
Patient assistance program data originates from pharmaceutical company CRM systems, pharmacy management systems, or third-party patient service platforms. Data updates are infrequent, typically synchronized in batches monthly or quarterly. Real-time updates occur only in urgent situations. The data is primarily structured, often in JSON or XML format. It includes basic patient information, diagnosis details, medication records, assistance plan status, and follow-up records. Field names are often English abbreviations or Pinyin, such as patientId, diagnosisCode, drugName, and assistanceStatus. Units for dosage are commonly milligrams (mg) or grams (g), time units are days (day) or months (month), and monetary units are Chinese Yuan (CNY).
Constraints from "HTTP Interface and External Systems"
The low update frequency of patient assistance data means FastGPT does not need to frequently poll external interfaces during integration, reducing unnecessary system overhead. The structured nature of the data simplifies the parsing rules for HTTP request bodies and response bodies, making it easy to pre-set parsing templates. The use of abbreviations and Pinyin for field names requires careful mapping to internal knowledge base fields when configuring interfaces in FastGPT to ensure semantic accuracy. The presence of numerical units for amounts and dosages necessitates strict type validation during data transmission and processing to prevent errors or confusion due to inconsistent units. Handling sensitive patient information mandates the use of HTTPS for interfaces and implementation of strict identity authentication and authorization mechanisms to ensure data security.
Configuration Guidelines
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
Request Method | POST or GET | Based on external system API documentation; queries typically use GET, operations use POST. |
Request URL | External system's API address, e.g., https://api.example.com/pa_data/query | Ensures FastGPT can correctly access the external data source. |
Request Header (Authorization) | Bearer <API_KEY> or Basic <BASE64_CREDENTIALS> | Required for external system interface authentication, ensuring secure data access. |
Timeout (timeout) | 60 seconds | Patient assistance data queries may involve complex business logic; this provides sufficient response time and prevents connection timeouts due to slow backend processing. |
Response Body Parsing Rule (responseParser) | JSONPath expression, e.g., $.data.list[*] | For structured JSON response bodies, this precisely extracts required field data. |
Error Code Handling (errorHandler) | Check $.code field, e.g., {"code": 401, "message": "Authentication Failed"} | Identifies business error codes returned by external interfaces for targeted error messages or retries. |
Common Pitfalls
- Symptom: FastGPT queries for patient assistance data are slow or time out. Reason: The external system API takes too long to process complex queries, and FastGPT's
Timeoutconfiguration is too short to wait for a complete response. - Symptom: The patient assistance plan status field obtained from the external system is empty or parsing errors occur. Reason: The relevant field name in the external system's JSON response does not match the
JSONPathexpression configured in FastGPT'sResponse Body Parsing Rule, preventing correct data extraction. - Symptom: An
HTTP 401 Unauthorizederror is received when calling the external system interface. Reason: TheAuthorizationparameter in theRequest Headeris not configured correctly, for example, theAPI_KEYis expired or malformed, leading to authentication failure.
Verification Steps
- In the FastGPT interface configuration, use simulated data for a
Testrun. Check if the returned HTTP status code is200and confirm that the response body data is parsed correctly. - Use FastGPT's
Debugfunction to observe actual request logs. Verify that parameters such asRequest URL,Request Header, andRequest Bodymatch the external system's API documentation requirements. - In FastGPT, use an actual patient ID to perform a knowledge base query. Verify that the system can successfully query and display relevant patient assistance information through the configured HTTP interface. Check if units for critical numerical fields like amounts and dosages are correct.
The values given are common starting points and should be measured against specific samples.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-21.