Nova postagem

查找

Pergunta
· jan 23

%REST.API swagger specs generation from comments / response type

Hi, I am currently setting up a new API using %CSP.REST - I've gotten swagger spec generation to work like such:

Class Api.DispatchRouter Extends %CSP.REST
{

XData UrlMap
{
<Routes>

<Map Prefix="/test" Forward="Api.Controllers.TestController"/>

<Route Url="/swagger" Method="GET" Call="SwaggerSpec"/>   
</Routes>
}

ClassMethod SwaggerSpec() As %Status
{
    Set tSC = ##class(%REST.API).GetWebRESTApplication($NAMESPACE, %request.Application, .swagger)
    Do swagger.info.%Remove("x-ISC_Namespace")
    Set swagger.basePath = "/csp/myapi"
    Set swagger.info.title = "My API"
    Set swagger.info.version = "0.0.0"
    Set swagger.host = "myhost.com"
    Return ..%WriteJSON($$$OK, swagger)
}

}
Class Api.Controllers.TestController Extends %CSP.REST
{

XData UrlMap
{
<Routes>

<Route Url="/:name" Method="GET" Call="Test"/>

</Routes>
}

/// This gets read by Swagger, can I add metadata here?
ClassMethod Test(name As %String) As %Status
{
    write "works!: " _ name, !
    Return $$$OK
}

}

 

This correctly reads all the endpoints inside the TestController based on the UrlMap, but it does not know the return type

I would like to be able to add additional info to each individual endpoint, for starters to manually define the possible return types/objects, as well as parameters from the %request, directly inside a comment above the ClassMethod.

 

I'd rather have it auto-generate the swaggerspec, so I'm wondering if anyone can point me in the right direction.

I have also heard of isc-rest package, but unless the features are outstanding, I'd prefer to stay away.

3 Comments
Discussão (3)1
Entre ou crie uma conta para continuar
Artigo
· jan 22 2min de leitura

第四章 C 开头的术语

 

# 第四章 C 开头的术语

#### 循环引用 (circular reference)

**对象(Objects)**

在不同类中的两个属性相互引用对方的集合。只要循环引用中的两个属性都不是必需属性,`IRIS` 完全支持循环引用。如果循环引用中的两个属性都是必需属性,你将无法保存这两个类的对象。

#### 类编译器 (class compiler)

**对象(Objects)**

类编译器用于编译`IRIS` 类。你可以在 `IDE` 中使用类编译器,或者通过 ` IRIS` 对象实用库中的编译调用来使用。

#### 类定义语言 (Class Definition Language)

**对象(Objects)**

`IRIS` 的类定义语言(`CDL`)是一种基于关键字的语言,用于定义 `IRIS` 中的类。

#### 类描述符 (class descriptor)

**对象(Objects)**

包含运行时信息(方法和属性列表)的特殊类型例程,用于使用对象。

#### 类字典 (class dictionary)

**对象(Objects)**

类字典保存所有已编译类的当前类定义。`SQL` 也使用类字典来确定有效的表定义。

#### 类层次结构 (class hierarchy)

**对象(Objects)**

类层次结构显示从每个根类到其每个子类及其子类的类链。

#### 类成员 (class member)

**对象(Objects)**

属于类的元素。类成员可以是属性、方法、参数、查询、索引、触发器或 `XData` 块。

#### 类方法 (class method)

**对象(Objects)**

无论其类的实例是否在内存中,都可以调用的方法。

#### 类 (class)

**对象(Objects)**

类封装了单一实体的状态和行为。一个类包括一些类型信息和一组类成员,包括属性、方法、参数、查询和索引。

`IRIS` 支持两种主要类型的类:数据类型类和对象类。它支持多种对象类,包括抽象类、抽象持久类、持久类、可嵌入类、非注册类、注册类和系统类。

#### 客户端数据类型 (client data type)

**对象(Objects)**

客户端数据类型用于指定通过`IRIS` 对象服务器向客户端投射数据所需的信息。每个数据类型类必须有一个客户端数据类型。基于数据类型类的属性将该类的客户端数据类型投射为属性的数据类型,以供 `SQL` 和 `Java` 等客户端使用。

#### 客户端锁 (client lock)

**系统**

请参见外发锁(outgoing lock)。

#### 客户端 (client)

**系统**

运行你应用程序的机器。它连接到数据库所在的服务器机器。也指网络上的一个节点,可以向其他节点请求信息。

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· jan 22

write local file in health connect cloud

Hello,

I hope this is a simple ask..

basically I need to create local files daily at a certain time for example 11:30pm.

1. file name needs to be like  xxx__20250113.txt , the date part should be next day's timestamp with format YYYYMMDD, so I will write about 17 files like that with different names.

2. write a dummy hard coded word for example “Dummy Word” in the file.  the file eventually will be used by other operations to add hl7 message on top of this  in it with the live interface message. 

3. this needs to be done every night at 11:45pm

So how am I going to implement this?

     1. Should this be like an operation on a schedule? If so, how exactly that can be done?

      2. Should I do this in Vss code and use task manager? If so, how can it be done?

Thanks for your input!

btw, this is on cloud version

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· jan 22

Transform rows to colums or colums to rows

Hello guys,

I need to tranform columns into rows or rows into columns.

I'm using only SQL Cache.

The code:

SELECT
    codRepresentante
    ,vendasAbril
    ,vendasAgosto
FROM
    Ped.MetasRepresen
WHERE ano = 2024

The columns: 

Can you help me?

Thanks

1 Comment
Discussão (1)1
Entre ou crie uma conta para continuar
Anúncio
· jan 22

[Video] Open Source LLMs

Hi Community!

We're happy to share the next video in the series dedicated to Gen AI on our InterSystems Developers YouTube:

⏯ Open Source LLMs

In this video, we explore the differences between open-source and proprietary large language models (LLMs). Proprietary models, like those from OpenAI or Google, operate as black boxes hosted in their cloud environments, offering high-quality performance but limiting data control and fine-tuning options. In contrast, open-source models can be downloaded and run locally, offering greater flexibility, transparency, and control over data, though they often require significant hardware resources and may deliver lower-quality output.

🗣  Presenter@Don Woodlock, Vice President, Healthcare Solutions Development, InterSystems

Enjoy watching, and look forward to more videos! 👍

Discussão (0)1
Entre ou crie uma conta para continuar