When we collect temporary data (the number of purchases in the store, the number of comments on the post), it may happen that there is no data for a certain period of time. In this case, this time period (hour, day, month) is not represented in the database, that is, there is not a single row for this period. In other words, there are no rows in the database for this period.
In this article, I would like to talk about the spec-first approach to REST API development.
While traditional code-first REST API development goes like this:
- Writing code
- REST-enabling it
- Documenting it (as a REST API)
Spec-first follows the same steps but reverse. We start with a spec, also doubling as documentation, generate a boilerplate REST app from that and finally write some business logic.
This is advantageous because:
- You always have relevant and useful documentation for external or frontend developers who want to use your REST API
- Specification created in OAS (Swagger) can be imported into a variety of tools allowing editing, client generation, API Management, Unit Testing and automation or simplification of many other tasks
- Improved API architecture. In code-first approach, API is developed method by method so a developer can easily lose track of the overall API architecture, however with the spec-first developer is forced to interact with an API from the position if API consumer which usually helps with designing cleaner API architecture
- Faster development - as all boilerplate code is automatically generated you won't have to write it, all that's left is developing business logic.
- Faster feedback loops - consumers can get a view of the API immediately and they can easier offer suggestions simply by modifying the spec
Let's develop our API in a spec-first approach!
I have successfully created REST service classes on my local IRIS server following this book: Using the /api/mgmnt/ Service | Creating REST Services | InterSystems IRIS Data Platform 2021.2
I am now 1) trying to edit impl.cls in VS Code and 2) export it to my local repo so I can push to the remote repo.
When I click on my project in VS Code and 'Add to project' and choose the new package, spec.cls and impl.cls, I get the following error:
ERROR #5540: SQLCODE: -114 Message: Unable to acquire lock for INSERT of child row for parent table '%Studio.Project' with parent id = 'Default_project'
I have a project that needs to get DSTU2 resources ultimately to CSV files. My thought was if I could get there Resources to R4 I could use the FHIR SQL builder to help map the data. Anyone have ideas? Maybe DSTU2 to SDA to R4...
Is there anyone using this callback in the code? I was searching in the latest IRIS documentation for any handy callbacks of the %Persistent class which allows me to execute some codes just right after a transaction has been committed (TCOMMIT). The description of this %OnSaveFinally() sounds the thing I want because it said:
If the calling method started a transaction then that transaction is completed prior to invoking the callback.
However, I later discovered in my own test that this callback is triggered after %Save(), not after TCOMMIT.
Hi:
Had an issue after upgrading to 2021.1 where search bar for interoability will bring up "INVALID ACTION".
On upgrading to 2022.1 this still occurs.
It did not occur on another environement that was upgraded from 2017.2 straight to 2022.1
Is there any solution? Loads up SYS in url rather than customnamespacename
Issue is the url for instance brings through ip/csp/sys/EnsPortal.DTLEditor.zen?$NAMESPACE=X
ip/csp/healthshare/customnamespace/EnsPortal.DTLEditor.zen?$NAMESPACE=X
I encountered this before and forget if there was a solution for this
Hello all,
i am currently struggling following the instructions for reading an image file into the database as a base64 string.
My goal is to save an image into a global as base64. I followed different guides like:
https://community.intersystems.com/post/how-save-png-image-cache-base64…
https://community.intersystems.com/post/how-save-fileimage-some-specifi…
https://cedocs.intersystems.com/ens20152/csp/documatic/%25CSP.Documatic…
Here is my current code:
We have a downstream application that cannot accept more than 500 messages at a time. They want to restrict the number of messages being sent to them at a time.
Hey Developers,
Learn the basics of HL7® V2 message management in InterSystems IRIS for Health™:
⏯ Introduction to HL7 V2 Integrations in InterSystems IRIS for Health
I would say it is a post of pain after years of using InterrSystems IRIS Docker images in many projects.
And I hope InterSystems will hear me and do something with it.
We have a lot of issues with Docker images, but I see no progress in solving them.
- containers.intersystems.com - any new releases substitute previous versions, makes build useless
- ARM64 images have separate names, and it makes a pain to use them
- flags in iris-main, appears and disappears from version to version, which may fail the start the container
- healthcheck does not work as expected
Hello,
I became aware of Python in the early 2000s when I started automating tasks. Some of our processes utilized python scripts. I never figured it out very well, and we decided to do away with Python because nobody on our team was familiar with it.
Along the way, I heard a lot about Python. My interest was renewed when InterSystems offered bonus points for using Python in contests.
The things I like the most about Python so far is how easy it is to find the mean of the ages of all Titanic passengers. For my test-data app I wanted to find the largest value in the ‘Qty’ column in a CSV file.
Hi Community,
Let's meet together at the online meetup with the winners of the InterSystems Full Stack contest – a great opportunity to have a discussion with InterSystems Experts team as well as our contestants. Winners' demo included!
Date & Time: Friday, July 22 – 12:00 PM EDT
Hi all,
I am looking at a task which involves processing an XML file. Picking the file up from a folder (c:\test.xml) reading the data out of the XML and archiving the xml after it has been processed.
I was wondering what the best way of doing this would be?
I have got as far as creating a service in Ensemble. The Service I have created uses the class name EnsLib.XML.Object.Service.FileService.
Any advice or tutorials/guides would be much appreciated.
Many Thanks
Hello,
I found another question on how to change the language for Studio (but it would've been nice to have my actual language used - Ukrainian, since it's available, or was available). Still, I can't seem to figure out how to get rid of gibberish in the menu without changing the Windows settings:
we are currently using Libre office to generate a PDF from docx file. but we want generate a PDF file without using the External libraries.
Is there any tool is available with in the Ensemble to covert a file from docx to PDF.
appreciate your help....
Hi all,
I've just update the version of WebTerminal using the link, but now it doesn't work.
When call to /terminal is displaying the following error:
{
"errors":[ {
"code":5002,
"domain":"%ObjectErrors",
"error":"ERROR #5002: Error de cache: <INVALID OREF>zWrite+5^WebTerminal.StaticContent.1",
"id":"ObjectScriptError",
"params":["<INVALID OREF>zWrite+5^WebTerminal.StaticContent.1"
]
}
],
"summary":"ERROR #5002: Error de cache: <INVALID OREF>zWrite+5^WebTerminal.StaticContent.1"
}Hi Guys,
this might be a dumb question but is Crystal report 2020 compatible with Ensemble 2014 datasource driver?
Thanks
How do I access items and their settings of production by using Objectscript? I have already tried making SQL queries to Ens_Config.Production table and using methods in Ens.Director and EnsPortal.Utils classes but I just can't get a hang of it.
Hi Community!
We are introducing a new feature on DC site - Best Practices of InterSystems Data Platforms.
It is the tag, which highlights articles on DC considered as Best Practices on how to develop, test, deploy and manage solutions on InterSystems Data Platforms.
Is there any full featured tutorial available for doing the report development using object script in the Trakcare system for a starter developer(For Trakcare)?
Once we developed the report and then how we can test and add this report to our existing Trakcare.
Our Organization is working towards a long term contract with regards to HealthShare implementation in the US and are interested in speaking with HealthShare unified care record certified consultants who reside in the continental united states. Send me an message if you are interested in knowing more.
Hi.
Why are relationship properties not included in %JSONExportToString() method even they have cardinality one or parent?
Regards,
Matjaž

Welcome to the May'22 Community Release!
We’ve made some enhancements to your experience recently in the InterSystems Community:
🆕 Improved current events tracking
🆕 Scheduled posting
🆕 Enhanced code formatting
🆕 Faster table creation
🆕 Enriched reply experience
🆕 Changed post teaser design
Let's have a closer look at all of these below.
Hi Community!
Want to keep pace with rapid changes in cutting edge technology? Join us for these Learning Services virtual classes, coming soon:
📅 July 25-29: HealthShare Unified Care Record Fundamentals
📅 Aug 8-12: Using InterSystems Embedded Analytics
Hi Developers!
We are introducing a new feature on Dev Community site – Key Questions by InterSystems Developers.
We've added a new special #Key Question tag to highlight questions related to InterSystems Data Platforms considered as having the biggest impact.
Each month InterSystems Experts will choose such questions, and those authors will be awarded with all the honours!
What honours? Details in this post!

Good morning. Perhaps someone can tell me if this IRIS health communit version (IRISHealth_Community-2022.1.0.209.0-lnxubuntu2004x64) is supposed
to work in an Ubuntu 20.04 LTS installation in an Oracle Virtual Box .
I am trying to install different versions on Ubuntu . I tried with the 18 version. No luck. Than I've tried with the 20.04 version. No luck either.
The error I am having now is below
///////////////////////// error message from the install ////////////////////////////////
home/epic/epicinstall/IRISHealth_Community-2022.1.0.209.0-lnxubuntu2004x64# ./irisinstall
Can I please check if anyone know why the data base resource is created differently when creating a namespace after specifically selecting it to use the default resource %DB_%DEFAULT?
I created a namespace and when creating the DB I selected the option to use the default resource
When the namespace creation was complete , database is using a new resource instead of the default.
Hi Community,
Just wanted to let you know there's still time to get a $25 dollar gift card from Gartner for reviewing our products. Reviews must be objective (no InterSystems employees) and approved by Gartner. Here is the link: https://gtnr.it/3ulVX4K
Hi Guys,
usually when I want to find out which class is a zen page is, I just right click on the page and go to properties and this will show me the class url, but with this client I don't get properties as below !?
Thanks
What will the ideal learning path for a DataScience & AI aspirant ?


