Skip to main content

Prompt

Para una primera versión sobre la que trabajar nosotros más tarde, es interesante usar un agente, Claude especialmente usando este prompt, que generará un .json generalmente bastante bueno de modelo, que podremos nosotros trabajar sobre él.

TASK: Generate a RadiXML Model JSON

You are an expert XML integration engineer. Your task is to generate a `model.json` file for the RadiXML converter system.

1. Context Information
- **Source Format Name**: [INSERT_SOURCE_NAME]
- **Target Format Name**: [INSERT_TARGET_NAME]
- **Sample Source XML**: 
```xml
[INSERT_SOURCE_SAMPLE]
-
  • **Sample Target XMLXML**:
[INSERT_TARGET_SAMPLE]

2.
    Requirements
  1. Requirements
  2. -
  • Create a single JSON object.
  • - **Root attributesattributes**: Include name`name`, description`description`, sourceFormat`sourceFormat`, targetFormat`targetFormat`, rootElement`rootElement`, and namespaces`namespaces`.
  • - **Logic RuleRule**: Use ONLY **JavaScript Custom NodesNodes** for any data transformation or calculation. Do NOT use transform`transform` nodes.
  • - **Connection RuleRule**: Every dynamic value must flow from a `Source NodeNode` -> `Custom NodeNode` -> `Target NodeNode`.
  • - **Static ValuesValues**: Use staticValue`staticValue` in the Target Node or value`value` in the structure`structure` for fields that never change.
3.
  1. Custom Node Implementation Guide A custom node must be structured as follows:
-
  • id[id](cci:1://file:///c:/Users/bolty/Desktop/RadiXML/RadiXML/frontend/src/converters/BaseConverter.js:179:2-189:3): Unique string (e.g., "custom-1234").
  • language- `language`: "javascript".
  • inputs- `inputs`: Defines variable names (e.g., DoseRateIn`DoseRateIn`).
  • outputs- `outputs`: Defines the result name (e.g., DoseRateOut`DoseRateOut`).
  • code- `code`: Must be a valid JS function. Example:
    function run() {
          // Inputs are accessible directly by name
          const val = parseFloat(DoseRateIn);
          return (val * 1000).toFixed(2); 
      }
    
    
    4.
  1. Model Anatomy Reference Use this structure as your template: { "name": "Format Converter", "rootElement": "RadInstrumentData", "namespaces": { "ns": "..." }, "nodes": { "sources": [ { "id": "src-1", "label": "Value", "path": "Path/To/Tag" } ], "targets": [ { "id": "tgt-1", "label": "Result", "path": "Result/Path" } ], "customs": [ { "id": "custom-1", "inputs": [{"name": "In"}], "outputs": [{"name": "Out"}], "code": "..." } ] }, "connections": [ { "from": "src-1", "to": "custom-1" }, { "from": "custom-1", "to": "tgt-1" } ], "structure": [ { "element": "Parent", "children": [ { "element": "Child", "value": "" } // Targeted by connections ] } ] }

  2. 5.
  3. Output Generate the full, valid JSON model based on the provided XML samples. Ensure every mandatory tag in the Target XML is present in the structure`structure`.