> For the complete documentation index, see [llms.txt](https://docs.debio.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.debio.network/appchain/appchain-function-spec.md).

# Appchain Function Spec

## Extrinsics function based on role :&#x20;

### **As general user (customer / lab)**&#x20;

* Wallet Binding : Pallet User Profile&#x20;
  * set\_eth\_address(eth\_address) : bind between polkadot and eth address&#x20;

### **As lab**

* Create, Update, Delete lab : Pallet Lab
  * registerLab(labInfo)&#x20;
  * updateLab(labInfo)&#x20;
  * deregisterLab()&#x20;
* Create, Update, Delete service : Pallet Service&#x20;
  * createService(service\_info)&#x20;
  * updateService(service\_id, service\_info)&#x20;
  * deleteService(service\_id)&#x20;
* Create, Update, Delete lab certification : Pallet certification&#x20;
  * createCertification(certification\_info)&#x20;
  * updateCertification(certification\_id, certification\_info)&#x20;
  * deleteCertification(certification\_id)
* &#x20;Process order : Pallet Genetic Testing&#x20;
  * rejectDnaSample(tracking\_id, rejected\_title, rejected\_description)&#x20;
  * processDnaSample(tracking\_id, status)&#x20;
  * submitTestResult(tracking\_id, submission)&#x20;
  * submitIndependentTestResult(submission)
  * submitDataStakingDetails(data\_hash)&#x20;
* Finished order : Pallet Order&#x20;
  * fulfillOrder(order\_id)&#x20;

### **As customer**&#x20;

* Create, Cancel order : Pallet Order&#x20;
  * createOrder(service\_id,price\_index, customer\_box\_public\_key)&#x20;
  * cancelOrder(order\_id)&#x20;
* Create, Update, Delete EMR : Pallet EMR&#x20;
  * addElectronicMedicalRecord()&#x20;
  * removeElectronicMedicalRecord()&#x20;
  * addElectronicMedicalRecordInfo(title, description)&#x20;
  * removeElectronicMedicalRecord(electronic\_medical\_record\_info\_id)&#x20;

### **As Escrow**

* Set Order to Paid : Pallet Order
  * setOrderPaid(orderId)
* Set Order to Refunded : Pallet Order
  * setOrderRefunded(orderId)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.debio.network/appchain/appchain-function-spec.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
