{
  "name": "IshedDB — patients de Dakar",
  "nodes": [
    {
      "id": "depart",
      "name": "Au lancement",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "reglages",
      "name": "Réglages",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "adresse",
              "name": "isheddbUrl",
              "value": "https://ADRESSE-DE-VOTRE-CLUSTER",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "ajout",
      "name": "Ajouter un patient",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "={{ $('Réglages').item.json.isheddbUrl }}/v1/bases/DB/collections/patients:insertOne",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"document\": {\n    \"nom\": \"Awa Diop\",\n    \"ville\": \"Dakar\"\n  }\n}",
        "options": {}
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "isheddb",
          "name": "IshedDB"
        }
      }
    },
    {
      "id": "lecture",
      "name": "Patients de Dakar",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "={{ $('Réglages').item.json.isheddbUrl }}/v1/bases/DB/collections/patients:find",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"filter\": {\n    \"ville\": \"Dakar\"\n  },\n  \"sort\": {\n    \"nom\": 1\n  },\n  \"limit\": 20\n}",
        "options": {}
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "isheddb",
          "name": "IshedDB"
        }
      }
    },
    {
      "id": "un-par-un",
      "name": "Un patient par élément",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        880,
        0
      ],
      "parameters": {
        "fieldToSplitOut": "documents",
        "options": {}
      }
    }
  ],
  "connections": {
    "Au lancement": {
      "main": [
        [
          {
            "node": "Réglages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Réglages": {
      "main": [
        [
          {
            "node": "Ajouter un patient",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ajouter un patient": {
      "main": [
        [
          {
            "node": "Patients de Dakar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Patients de Dakar": {
      "main": [
        [
          {
            "node": "Un patient par élément",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
